diff options
author | michael pereira | 2011-04-21 14:03:56 +0200 |
---|---|---|
committer | michael pereira | 2011-04-21 14:03:56 +0200 |
commit | 583ccfa017f2a57776d70cf1b80a7dbb1228124c (patch) | |
tree | c58419423f503e31ec06b547e6c2ec4fbe554109 | |
parent | merges (diff) | |
download | pbs2-583ccfa017f2a57776d70cf1b80a7dbb1228124c.tar.gz pbs2-583ccfa017f2a57776d70cf1b80a7dbb1228124c.tar.xz pbs2-583ccfa017f2a57776d70cf1b80a7dbb1228124c.zip |
updates raus
-rw-r--r-- | api_preboot_test.html | 1 | ||||
-rw-r--r-- | application/controllers/ErrorController.php | 4 | ||||
-rw-r--r-- | application/controllers/ResourceController.php | 10 | ||||
-rw-r--r-- | application/models/BootIso.php | 10 | ||||
-rw-r--r-- | application/models/BootIsoMapper.php | 8 | ||||
-rw-r--r-- | application/models/BootOs.php | 30 | ||||
-rw-r--r-- | application/models/BootOsMapper.php | 8 | ||||
-rw-r--r-- | application/models/Config.php | 39 | ||||
-rw-r--r-- | application/models/ConfigMapper.php | 6 | ||||
-rw-r--r-- | application/modules/user/controllers/BootmenuController.php | 2 | ||||
-rw-r--r-- | application/modules/user/controllers/PrebootController.php | 51 | ||||
-rw-r--r-- | application/modules/user/forms/Bootiso.php | 13 | ||||
-rw-r--r-- | application/modules/user/forms/Preboot.php | 14 | ||||
-rw-r--r-- | library/Pbs/Notifier.php | 3 | ||||
-rw-r--r-- | setup/pbs-newdata.sql | 16 | ||||
-rw-r--r-- | setup/pbs.sql | 16 |
16 files changed, 126 insertions, 105 deletions
diff --git a/api_preboot_test.html b/api_preboot_test.html index 05f4fd2..5c3805b 100644 --- a/api_preboot_test.html +++ b/api_preboot_test.html @@ -1,5 +1,6 @@ <form enctype='multipart/form-data' action='http://127.0.0.2/resource/addpreboot/apikey/apikey1' method='POST'> Title:<input name='title' type='text'/> +Description:<input name='description' type='text'/> Preboot File:<input name='preboot' type='file'/> <input type='submit' value='Upload'/> </form> diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index abf3ec1..a9a448d 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -26,13 +26,13 @@ class ErrorController extends Zend_Controller_Action $this->getResponse()->setHttpResponseCode(404); $this->view->message = 'Page not found'; $this->_redirect('/user/'); - # print_a($errors); + print_a($errors); break; default: // application error $this->getResponse()->setHttpResponseCode(500); $this->view->message = 'Application error - Please contact the admin'; - # print_a($errors); + print_a($errors); break; } diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index 88ec38e..5790dbd 100644 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -34,8 +34,6 @@ class ResourceController extends Zend_Controller_Action $membershipMapper = new Application_Model_MembershipMapper(); $this->membership = new Application_Model_Membership(); $this->rightrolesMapper = new Application_Model_RightRolesMapper(); - - $rightroles = new Application_Model_RightRoles(); @list($this->membership) = $membershipMapper->findBy(array('apikey' => $apikey)); if($this->membership == null){ @@ -125,9 +123,6 @@ class ResourceController extends Zend_Controller_Action $bootos->setOptions($params); $bootos->setGroupID($groupID); $bootos->setSource($source); - $bootos->setPath_config($_FILES['config']['name']); - $bootos->setPath_init($_FILES['init']['name']); - $bootos->setPath_kernel($_FILES['kernel']['name']); $bootos->setCreated(time()); $bootos->setPublic('-1'); $bootosID = $bootosMapper->save($bootos); @@ -194,9 +189,6 @@ class ResourceController extends Zend_Controller_Action $bootos->setID($bootosID); $bootos->setGroupID($groupID); $bootos->setSource($_SERVER['REMOTE_ADDR']); - $bootos->setPath_config($_FILES['config']['name']); - $bootos->setPath_init($_FILES['init']['name']); - $bootos->setPath_kernel($_FILES['kernel']['name']); $bootos->setCreated(time()); $bootos->setPublic('-1'); @@ -266,7 +258,6 @@ class ResourceController extends Zend_Controller_Action $preboot->setOptions($params); $preboot->setGroupID($groupID); $preboot->setSource($source); - $preboot->setPath_preboot($_FILES['preboot']['name']); $preboot->setCreated(time()); $prebootID = $prebootMapper->save($preboot); @@ -327,7 +318,6 @@ class ResourceController extends Zend_Controller_Action $preboot->setOptions($params); $preboot->setGroupID($groupID); $preboot->setSource($source); - $preboot->setPath_preboot($_FILES['preboot']['name']); $preboot->setCreated(time()); $prebootMapper->save($preboot); diff --git a/application/models/BootIso.php b/application/models/BootIso.php index fe06947..e34c3b8 100644 --- a/application/models/BootIso.php +++ b/application/models/BootIso.php @@ -14,6 +14,7 @@ class Application_Model_BootIso { protected $_bootisoID; protected $_title; + protected $_description; protected $_prebootID; protected $_membershipID; protected $_groupID; @@ -162,6 +163,15 @@ class Application_Model_BootIso $this->_bootisoID = $_bootisoID; return $this; } + public function getDescription() + { + return $this->_description; + } + public function setDescription($_description) + { + $this->_description = $_description; + return $this; + } /** * Returns current data as associative array using ReflectionClass * diff --git a/application/models/BootIsoMapper.php b/application/models/BootIsoMapper.php index c58777f..6ca7ad3 100644 --- a/application/models/BootIsoMapper.php +++ b/application/models/BootIsoMapper.php @@ -82,7 +82,7 @@ class Application_Model_BootIsoMapper public function save(Application_Model_BootIso $botiso) { - $data = array('bootisoID'=> $botiso->getID() ,'membershipID'=> $botiso->getMembershipID() ,'title'=> $botiso->getTitle(),'prebootID'=> $botiso->getPrebootID() ,'groupID'=> $botiso->getGroupID() ,'serialnumber'=> $botiso->getSerialnumber() ,'created'=> $botiso->getCreated() ,'expires'=> $botiso->getExpires() ,'public'=> $botiso->getPublic() ); + $data = array('bootisoID'=> $botiso->getID() ,'membershipID'=> $botiso->getMembershipID() ,'title'=> $botiso->getTitle(),'prebootID'=> $botiso->getPrebootID() ,'groupID'=> $botiso->getGroupID() ,'serialnumber'=> $botiso->getSerialnumber() ,'created'=> $botiso->getCreated() ,'expires'=> $botiso->getExpires() ,'public'=> $botiso->getPublic(), 'description' => $botiso->getDescription() ); if (null === ($id = $botiso->getID()) ) { unset($data['bootisoID']); @@ -112,10 +112,10 @@ class Application_Model_BootIsoMapper if($botiso == null){ $botiso = new Application_Model_BootIso(); - $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public); + $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description); return $botiso; }else{ - $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public); + $botiso->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description); } } @@ -126,7 +126,7 @@ class Application_Model_BootIsoMapper foreach ($resultSet as $row) { $entry = new Application_Model_BootIso(); - $entry->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public); + $entry->setID($row->bootisoID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPrebootID($row->prebootID)->setGroupID($row->groupID)->setSerialnumber($row->serialnumber)->setCreated($row->created)->setExpires($row->expires)->setPublic($row->public)->setDescription($row->description); $entries[] = $entry; } diff --git a/application/models/BootOs.php b/application/models/BootOs.php index 9819c29..f095720 100644 --- a/application/models/BootOs.php +++ b/application/models/BootOs.php @@ -16,9 +16,6 @@ class Application_Model_BootOs protected $_groupID; protected $_membershipID; protected $_title; - protected $_path_init; - protected $_path_kernel; - protected $_path_config; protected $_defaultkcl; protected $_created; protected $_description; @@ -77,15 +74,6 @@ class Application_Model_BootOs $this->_bootosID = $_bootosID; return $this; } - public function getPath_config() - { - return $this->_path_config; - } - public function setPath_config($_path_config) - { - $this->_path_config = $_path_config; - return $this; - } public function getGroupID() { return $this->_groupID; @@ -122,24 +110,6 @@ class Application_Model_BootOs $this->_description = $_description; return $this; } - public function getPath_init() - { - return $this->_path_init; - } - public function setPath_init($_path_init) - { - $this->_path_init = $_path_init; - return $this; - } - public function getPath_kernel() - { - return $this->_path_kernel; - } - public function setPath_kernel($_path_kernel) - { - $this->_path_kernel = $_path_kernel; - return $this; - } public function getDefaultkcl() { return $this->_defaultkcl; diff --git a/application/models/BootOsMapper.php b/application/models/BootOsMapper.php index d18c55a..2bde6db 100644 --- a/application/models/BootOsMapper.php +++ b/application/models/BootOsMapper.php @@ -83,7 +83,7 @@ class Application_Model_BootOsMapper public function save(Application_Model_BootOs $botos) { - $data = array('bootosID'=> $botos->getID() ,'path_config'=> $botos->getPath_config() ,'groupID'=> $botos->getGroupID() ,'title'=> $botos->getTitle(), 'membershipID'=> $botos->getMembershipID() ,'path_init'=> $botos->getPath_init() ,'path_kernel'=> $botos->getPath_kernel() ,'defaultkcl'=> $botos->getDefaultkcl() ,'created'=> $botos->getCreated() ,'description'=> $botos->getDescription() ,'expires'=> $botos->getExpires() ,'public'=> $botos->getPublic(),'source'=> $botos->getSource(),'distro'=> $botos->getDistro(),'distroversion'=> $botos->getDistroversion(),'shortname'=> $botos->getShortname(),'share'=> $botos->getShare() ); + $data = array('bootosID'=> $botos->getID() ,'groupID'=> $botos->getGroupID() ,'title'=> $botos->getTitle(), 'membershipID'=> $botos->getMembershipID(),'defaultkcl'=> $botos->getDefaultkcl() ,'created'=> $botos->getCreated() ,'description'=> $botos->getDescription() ,'expires'=> $botos->getExpires() ,'public'=> $botos->getPublic(),'source'=> $botos->getSource(),'distro'=> $botos->getDistro(),'distroversion'=> $botos->getDistroversion(),'shortname'=> $botos->getShortname(),'share'=> $botos->getShare() ); if (null === ($id = $botos->getID()) ) { unset($data['bootosID']); return $this->getDbTable()->insert($data); @@ -112,10 +112,10 @@ class Application_Model_BootOsMapper if($botos == null){ $botos = new Application_Model_BootOs(); - $botos->setID($row->bootosID)->setPath_config($row->path_config)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPath_init($row->path_init)->setPath_kernel($row->path_kernel)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public)->setSource($row->source)->setDistro($row->distro)->setDistroversion($row->distroversion)->setShortname($row->shortname)->setShare($row->share); + $botos->setID($row->bootosID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public)->setSource($row->source)->setDistro($row->distro)->setDistroversion($row->distroversion)->setShortname($row->shortname)->setShare($row->share); return $botos; }else{ - $botos->setID($row->bootosID)->setPath_config($row->path_config)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPath_init($row->path_init)->setPath_kernel($row->path_kernel)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public)->setSource($row->source)->setDistro($row->distro)->setDistroversion($row->distroversion)->setShortname($row->shortname)->setShare($row->share); + $botos->setID($row->bootosID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public)->setSource($row->source)->setDistro($row->distro)->setDistroversion($row->distroversion)->setShortname($row->shortname)->setShare($row->share); } } @@ -127,7 +127,7 @@ class Application_Model_BootOsMapper foreach ($resultSet as $row) { $entry = new Application_Model_BootOs(); - $entry->setID($row->bootosID)->setPath_config($row->path_config)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setPath_init($row->path_init)->setPath_kernel($row->path_kernel)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public)->setSource($row->source)->setDistro($row->distro)->setDistroversion($row->distroversion)->setShortname($row->shortname)->setShare($row->share); + $entry->setID($row->bootosID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setTitle($row->title)->setDefaultkcl($row->defaultkcl)->setCreated($row->created)->setDescription($row->description)->setExpires($row->expires)->setPublic($row->public)->setSource($row->source)->setDistro($row->distro)->setDistroversion($row->distroversion)->setShortname($row->shortname)->setShare($row->share); $entries[$row->bootosID] = $entry; } diff --git a/application/models/Config.php b/application/models/Config.php index 5e3a7eb..3b609af 100644 --- a/application/models/Config.php +++ b/application/models/Config.php @@ -16,7 +16,9 @@ class Application_Model_Config protected $_groupID; protected $_membershipID; protected $_title; - protected $_shellscript; + protected $_description; + protected $_visible; + protected $_bootosID; protected $_created; public function __construct(array $options = null) @@ -84,15 +86,6 @@ class Application_Model_Config $this->_membershipID = $_membershipID; return $this; } - public function getShellscript() - { - return $this->_shellscript; - } - public function setShellscript($_shellscript) - { - $this->_shellscript = $_shellscript; - return $this; - } public function getTitle() { return $this->_title; @@ -111,6 +104,32 @@ class Application_Model_Config $this->_created = $_created; return $this; } + public function getDescription() + { + return $this->_description; + } + public function setDescription($_description) + { + $this->_description = $_description; + return $this; + } + public function getVisible() + { + return $this->_visible; + } + public function setVisible($_visible) + { + $this->_visible = $_visible; + return $this; + } + public function getBootosID() + { + return $this->_bootosID; + } + public function setBootosID($_bootosID) + { + return $this; + } /** * Returns current data as associative array using ReflectionClass diff --git a/application/models/ConfigMapper.php b/application/models/ConfigMapper.php index 526eee1..da16aa2 100644 --- a/application/models/ConfigMapper.php +++ b/application/models/ConfigMapper.php @@ -83,7 +83,7 @@ class Application_Model_ConfigMapper public function save(Application_Model_Config $config) { - $data = array('configID'=> $config->getID() ,'groupID'=> $config->getGroupID(), 'membershipID'=> $config->getMembershipID(), 'shellscript'=> $config->getShellscript(), 'title'=> $config->getTitle() , 'created'=> $config->getCreated() ); + $data = array('configID'=> $config->getID() ,'groupID'=> $config->getGroupID(), 'membershipID'=> $config->getMembershipID(), 'title'=> $config->getTitle() , 'created'=> $config->getCreated(), 'description' => $config->getDescription(), 'visible' => $config->getVisible(), 'bootosID' => $config->getBootosID() ); if (null === ($id = $config->getID()) ) { unset($data['configID']); @@ -117,7 +117,7 @@ class Application_Model_ConfigMapper $row = $result->current(); - $config->setID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setCreated($row->created)->setShellscript($row->shellscript)->setTitle($row->title); + $config->setID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setCreated($row->created)->setTitle($row->title)->setDescription($row->description)->setVisible($row->Visible)->setBootosID($row->bootosID); if($return){ return $config; } @@ -130,7 +130,7 @@ class Application_Model_ConfigMapper foreach ($resultSet as $row) { $entry = new Application_Model_Config(); - $entry->setID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setCreated($row->created)->setShellscript($row->shellscript)->setTitle($row->title); + $entry->setID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setCreated($row->created)->setTitle($row->title)->setDescription($row->description)->setVisible($row->Visible)->setBootosID($row->bootosID); $entries[] = $entry; } diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index f901568..38b278c 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -95,7 +95,7 @@ class user_BootmenuController extends Zend_Controller_Action if($bootmenuentry->getKclappend() == null) $bootmenuentry->setKclappend("none (edit Bootmenuentry to set KCL-Append)"); $bootmenuentry->setBootosID("[".$bootmenuentry->getBootosID()."] ".$bootosMapper->find($bootmenuentry->getBootosID())->getTitle()); - $bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->gettitle()); + $bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->getTitle()); } } }else{ diff --git a/application/modules/user/controllers/PrebootController.php b/application/modules/user/controllers/PrebootController.php index 2b2955d..730debb 100644 --- a/application/modules/user/controllers/PrebootController.php +++ b/application/modules/user/controllers/PrebootController.php @@ -117,41 +117,46 @@ class User_PrebootController extends Zend_Controller_Action if ($prebootForm->isValid($_POST)) { - $preboot = new Application_Model_PreBoot($_POST); - $preboot->setGroupID($this->membership->getGroupID()); - + $groupID = $this->membership->getGroupID(); + $source = $_SERVER['REMOTE_ADDR']; + try { - - $path_tmp = "../resources/bootmedium/"; - mkdir($path_tmp ,0777, true); - - $hash = md5(microtime(1)); - exec("wget -O '".$path_tmp."preboot.zip".$hash."' ".escapeshellcmd($preboot->getPath_preboot())." 2>&1 | grep 'saved'", $status); - - if(!array_pop($status)){ - $this->view->prebootForm = $prebootForm; - $pbsNotifier = new Pbs_Notifier(); - echo $pbsNotifier->notify('The Resource was not found on the specified path','error'); - - return; + if($_FILES['preboot']['size'] == 0 && $_FILES['preboot']['name'] != ''){ + $this->_redirect('/user/preboot/index/page/'.$this->page.'/addresult/file'); + } + + list($preboot) = $this->prebootMapper->findBy(array('groupid' => $groupID, 'title' => $_POST['title'])); + if($preboot != null){ + header('HTTP/1.0 400 Preboot already exists'); + die(); } - + + + $preboot = new Application_Model_PreBoot($_POST); + + $preboot->setGroupID($groupID); + $preboot->setSource($source); + $preboot->setCreated(time()); + $prebootID = $this->prebootMapper->save($preboot); + + $prebootpath = "../resources/bootmedium/".$prebootID."/"; + mkdir($prebootpath ,0777, true); + + if(isset($_FILES['preboot'])){ + move_uploaded_file($_FILES['preboot']['tmp_name'], $prebootpath."preboot.zip"); + } - $path_preboot = "../resources/bootmedium/$prebootID/"; - mkdir($path_preboot ,0777, true); - - exec("mv ../resources/bootmedium/preboot.zip$hash ../resources/bootmedium/$prebootID/preboot.zip"); }catch(Zend_Exception $e) { echo "Caught exception: " . get_class($e) . "<br/>"; echo "Message: " . $e->getMessage() . "<br/>"; - $this->_redirect('/user/preboot/index/page/'.$this->page.'/addresult/error'); + //$this->_redirect('/user/preboot/index/page/'.$this->page.'/addresult/error'); //TODO Delete folder + preboot in DB } - $this->_redirect('/user/preboot/index/page/'.$this->page.'/addresult/ok'); + //$this->_redirect('/user/preboot/index/page/'.$this->page.'/addresult/ok'); } } diff --git a/application/modules/user/forms/Bootiso.php b/application/modules/user/forms/Bootiso.php index 6ec9eb7..af474b5 100644 --- a/application/modules/user/forms/Bootiso.php +++ b/application/modules/user/forms/Bootiso.php @@ -50,6 +50,17 @@ class user_Form_Bootiso extends Zend_Form 'label' => 'Title:', )); + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Description:', + )); + $prebootfield = $this->createElement('select','prebootID'); $prebootfield->setLabel('Preboot:'); $prebootfield->setAttrib('readOnly', $meta); @@ -77,7 +88,7 @@ class user_Form_Bootiso extends Zend_Form 'readOnly' => $meta, 'value' => $serial )); - + $date = new DateTime(); $date->add(new DateInterval('P1Y')); $this->addElement('text', 'expires', array( diff --git a/application/modules/user/forms/Preboot.php b/application/modules/user/forms/Preboot.php index 0b69c12..634b2b7 100644 --- a/application/modules/user/forms/Preboot.php +++ b/application/modules/user/forms/Preboot.php @@ -41,14 +41,24 @@ class user_Form_Preboot extends Zend_Form 'required' => true, 'label' => 'Title:', )); + + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Description:', + )); - $this->addElement('file', 'prebootfile', array( + $this->addElement('file', 'preboot', array( 'required' => true, 'readOnly' => $meta, 'label' => 'Preboot:', )); - if($this->action == "createpreboot") $label = "Create Preboot"; else diff --git a/library/Pbs/Notifier.php b/library/Pbs/Notifier.php index 918bedf..509d7de 100644 --- a/library/Pbs/Notifier.php +++ b/library/Pbs/Notifier.php @@ -90,6 +90,9 @@ class Pbs_Notifier{ case "error": $result = "<div class='warningbox'>Creation failed</div>"; break; + case "file": + $result = "<div class='errorbox'>The File must be greater than 0 bytes</div>"; + break; } break; case "update": diff --git a/setup/pbs-newdata.sql b/setup/pbs-newdata.sql index 1231cf1..a290008 100644 --- a/setup/pbs-newdata.sql +++ b/setup/pbs-newdata.sql @@ -93,16 +93,16 @@ INSERT INTO `pbs_bootos` (`bootosID`, `path_config`, `groupID`, `membershipID`, -- Adding preboot -INSERT INTO `pbs_preboot` (`prebootID`, `title`, `membershipID`, `groupID`, `path_preboot`, `created`, `source`) VALUES -(1, 'Preboot 1', 1, 1, 'path 1', '1299694422', 'source1'), -(2, 'Preboot 2', 1, 1, 'path 2', '1299694422', 'source1'), -(3, 'Preboot 3', 1, 1, 'path 3', '1299694422', 'source1'); +INSERT INTO `pbs_preboot` (`prebootID`, `title`, `membershipID`, `groupID`, `created`, `source`, `description`) VALUES +(1, 'Preboot 1', 1, 1, '1299694422', 'source1', 'Description 1'), +(2, 'Preboot 2', 1, 1, '1299694422', 'source1', 'Description 2'), +(3, 'Preboot 3', 1, 1, '1299694422', 'source1', 'Description 3'); -- Adding bootiso -INSERT INTO `pbs_bootiso` (`bootisoID`, `title`, `membershipID`, `groupID`, `prebootID`, `serialnumber`, `created`, `expires`, `public`) VALUES -(1, 'BootMedium 1', 1, 1, '1', '10-20-30-40-50', '123', '2012-03-09', 0), -(2, 'BootMedium 2', 1, 1, '2', '11-20-30-40-50', '456', '2012-03-09', 0), -(3, 'BootMedium 3', 1, 1, '3', '12-20-30-40-50', '789', '2012-03-09', 0); +INSERT INTO `pbs_bootiso` (`bootisoID`, `title`, `membershipID`, `groupID`, `prebootID`, `serialnumber`, `created`, `expires`, `public`, `description`) VALUES +(1, 'BootMedium 1', 1, 1, '1', '10-20-30-40-50', '123', '2012-03-09', 0, 'Description 1'), +(2, 'BootMedium 2', 1, 1, '2', '11-20-30-40-50', '456', '2012-03-09', 0, 'Description 2'), +(3, 'BootMedium 3', 1, 1, '3', '12-20-30-40-50', '789', '2012-03-09', 0, 'Description 3'); -- Adding Pools INSERT INTO `pbs_pool` (`poolID`, `groupID`, `title`, `description`, `location`) VALUES diff --git a/setup/pbs.sql b/setup/pbs.sql index 491bfc3..0084a34 100644 --- a/setup/pbs.sql +++ b/setup/pbs.sql @@ -120,19 +120,23 @@ ALTER TABLE `pbs_membership` CREATE TABLE IF NOT EXISTS `pbs_config` ( `configID` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(30) NOT NULL, + `description` varchar(140), `groupID` int(11), `membershipID` int(11), `visible` tinyint(1) DEFAULT '0', `created` VARCHAR(14) NOT NULL, + `bootosID` int(11) NOT NULL, PRIMARY KEY (`configID`), KEY `groupID` (`groupID`), - KEY `membershipID` (`membershipID`) + KEY `membershipID` (`membershipID`), + KEY `bootosID` (`bootosID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; ALTER TABLE `pbs_config` ADD CONSTRAINT `pbs_config_ibfk_1` FOREIGN KEY (`membershipID`) REFERENCES `pbs_membership` (`membershipID`) ON DELETE CASCADE, - ADD CONSTRAINT `pbs_config_ibfk_2` FOREIGN KEY (`groupID`) REFERENCES `pbs_group` (`groupID`) ON DELETE CASCADE; - + ADD CONSTRAINT `pbs_config_ibfk_2` FOREIGN KEY (`groupID`) REFERENCES `pbs_group` (`groupID`) ON DELETE CASCADE, + ADD CONSTRAINT `pbs_config_ibfk_3` FOREIGN KEY (`bootosID`) REFERENCES `pbs_bootos` (`bootosID`) ON DELETE CASCADE; + CREATE TABLE IF NOT EXISTS `pbs_hometype` ( `hometypeID` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, @@ -165,9 +169,6 @@ CREATE TABLE IF NOT EXISTS `pbs_bootos` ( `source` varchar(140), `share` varchar(30), `shortname` varchar(30), - `path_init` varchar(140), - `path_kernel` varchar(140), - `path_config` varchar(140), `defaultkcl` varchar(255), `created` VARCHAR(14) NOT NULL, `expires` VARCHAR(14), @@ -221,9 +222,9 @@ ALTER TABLE `pbs_bootmenuentries` CREATE TABLE IF NOT EXISTS `pbs_preboot` ( `prebootID` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(30) NOT NULL, + `description` varchar(140), `membershipID` int(11), `groupID` int(11) NOT NULL, - `path_preboot` varchar(140) NOT NULL, `source` varchar(140), `created` VARCHAR(14) NOT NULL, PRIMARY KEY (`prebootID`), @@ -239,6 +240,7 @@ ALTER TABLE `pbs_preboot` CREATE TABLE IF NOT EXISTS `pbs_bootiso` ( `bootisoID` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(30) NOT NULL, + `description` varchar(140), `membershipID` int(11), `groupID` int(11) NOT NULL, `prebootID` int(11) NOT NULL, |