From 9f26be7f273a1c16fee2a369eb6c8dbcfdc83cdd Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 9 Mar 2011 14:43:40 +0100 Subject: Icons ins Oberlfäche hinzugefügt & Views geupdated & style geupdated & select in free clients hinzugefügt --- application/views/scripts/bootiso/index.phtml | 8 +++---- application/views/scripts/bootmenu/index.phtml | 22 +++++++++---------- application/views/scripts/bootos/index.phtml | 8 +++---- application/views/scripts/client/index.phtml | 8 +++---- application/views/scripts/config/index.phtml | 8 +++---- application/views/scripts/filter/index.phtml | 24 ++++++++++----------- application/views/scripts/pool/index.phtml | 30 +++++++++++++++----------- application/views/scripts/session/index.phtml | 8 +++---- 8 files changed, 60 insertions(+), 56 deletions(-) (limited to 'application/views/scripts') diff --git a/application/views/scripts/bootiso/index.phtml b/application/views/scripts/bootiso/index.phtml index 20de6a1..5e7da1e 100644 --- a/application/views/scripts/bootiso/index.phtml +++ b/application/views/scripts/bootiso/index.phtml @@ -28,22 +28,22 @@ escape(date('Y-m-d H:i:s', $bootiso->getCreated())); ?> escape($bootiso->getExpires()); ?> escape($bootiso->getPublic()); ?> - url( array( 'controller' => 'bootiso', 'action' => 'editbootiso', 'bootisoID' => $bootiso->getID() ), 'default', - true, false) ?>">Edit BootISO - Edit BootISO + Delete BootISO + true) ?>">Delete BootISO diff --git a/application/views/scripts/bootmenu/index.phtml b/application/views/scripts/bootmenu/index.phtml index 019a799..6fb55e4 100644 --- a/application/views/scripts/bootmenu/index.phtml +++ b/application/views/scripts/bootmenu/index.phtml @@ -22,23 +22,23 @@ escape($bootmenu->getGroupID()); ?> escape($bootmenu->getMembershipID()); ?> escape(date('Y-m-d H:i:s', $bootmenu->getCreated())); ?> - url( array( 'controller' => 'bootmenu', 'action' => 'editbootmenu', 'bootmenuID' => $bootmenu->getID() ), 'default', - true, false) ?>">Edit Bootmenu - Edit Bootmenu + Delete Bootmenu - Delete Bootmenu + Add Entry + true) ?>">Add Entry bootmenuentrylist[$bootmenu->getID()]) > 0):?> - + ↳ @@ -78,7 +78,7 @@ - - + + true) ?>">Remove Entry
escape($bootmenuentry->getkcl()); ?> escape($bootmenuentry->getConfigID()."] ". $config->getTitle()); ?> escape($bootmenuentry->getOrder() + 1); ?>url( array( 'controller' => 'bootmenu', 'action' => 'editbootmenuentry', @@ -88,15 +88,15 @@ 'oldorder' => $bootmenuentry->getOrder() ), 'default', - true, false) ?>">Edit EntryEdit EntryRemove Entry
diff --git a/application/views/scripts/bootos/index.phtml b/application/views/scripts/bootos/index.phtml index df4f072..6da7a16 100644 --- a/application/views/scripts/bootos/index.phtml +++ b/application/views/scripts/bootos/index.phtml @@ -35,22 +35,22 @@ escape(date('Y-m-d H:i:s', $bootos->getCreated())); ?> escape($bootos->getExpires()); ?> escape($bootos->getPublic()); ?> - url( array( 'controller' => 'bootos', 'action' => 'editbootos', 'bootosID' => $bootos->getID() ), 'default', - true, false) ?>">Edit BootOS - Edit BootOS + Delete BootOS + true) ?>">Delete BootOS diff --git a/application/views/scripts/client/index.phtml b/application/views/scripts/client/index.phtml index 9ef344b..fd7725c 100644 --- a/application/views/scripts/client/index.phtml +++ b/application/views/scripts/client/index.phtml @@ -16,22 +16,22 @@ escape($client->getID()) ?> escape($client->getMacadress()) ?> escape($client->getHardwarehash()) ?> - url( array( 'controller' => 'client', 'action' => 'editclient', 'clientID' => $client->getID() ), 'default', - true) ?>">edit client - Edit Client + remove client + true) ?>">Delete Client diff --git a/application/views/scripts/config/index.phtml b/application/views/scripts/config/index.phtml index 6457d8f..5562b86 100644 --- a/application/views/scripts/config/index.phtml +++ b/application/views/scripts/config/index.phtml @@ -23,22 +23,22 @@ escape($config->getMembershipID()); ?> escape($config->getShellscript()); ?> escape(date('Y-m-d H:i:s', $config->getCreated())); ?> - url( array( 'controller' => 'config', 'action' => 'editconfig', 'configID' => $config->getID() ), 'default', - true, false) ?>">Edit Config - Edit Config + Delete Config + true) ?>">Delete Config diff --git a/application/views/scripts/filter/index.phtml b/application/views/scripts/filter/index.phtml index 253d14d..6f98b4c 100644 --- a/application/views/scripts/filter/index.phtml +++ b/application/views/scripts/filter/index.phtml @@ -1,5 +1,5 @@

Filters

-formButton('createconfig', 'Add Filter', array( +formButton('createconfig', 'Create Filter', array( 'onclick' => 'self.location="/filter/addfilter"', 'class' => 'addbutton'))?> @@ -18,33 +18,33 @@ escape($filter->title) ?> escape($filter->priority) ?> escape($filter->bootmenuID) ?> - url( array( 'controller' => 'filter', 'action' => 'editfilter', 'filterID' => $filter->getID() ), 'default', - true) ?>">edit filter - Edit Filter + delete filter - Delete Filter + add filterentry + true) ?>">Add Filterentry - + ↳ - url( array( 'controller' => 'filter', 'action' => 'editfilterentry', 'filterentriesID' => $filterentry['filterentriesID'] ), 'default', - true) ?>">edit filterentry - Edit Filterentry + remove filterentry + true) ?>">Delete Filterentry diff --git a/application/views/scripts/pool/index.phtml b/application/views/scripts/pool/index.phtml index 68fcbc4..f89dbc9 100644 --- a/application/views/scripts/pool/index.phtml +++ b/application/views/scripts/pool/index.phtml @@ -18,33 +18,33 @@ escape($pool->getTitle()) ?> escape($pool->getDescription()) ?> escape($pool->getLocation()) ?> - url( array( 'controller' => 'pool', 'action' => 'editpool', 'poolID' => $pool->getID() ), 'default', - true) ?>">edit pool - Edit Pool + delete pool - Delete Pool + link client + true) ?>">Link Client - + ↳ @@ -66,21 +66,21 @@ ?> - + true) ?>">Unlink Client
macAdress); ?> hardwarehash); ?>url( array( 'controller' => 'pool', 'action' => 'unlinkclient', 'poolentriesID' => $client['poolentriesID'] ), 'default', - true) ?>">unlink client

Free clients

- +
pools as $pool): ?> @@ -92,8 +92,9 @@ foreach ($this->freeclients as $client): ?> + - + true) ?>">getTitle(); ?> + ?> + + +
ClientIDMacAdressHardwarehash escape($pool->getTitle()) ?> 'pool', 'action' => 'linkclient', @@ -101,8 +102,11 @@ foreach ($this->freeclients as $client): ?> 'poolID' => $pool->getID(), ), 'default', - true) ?>'>link
diff --git a/application/views/scripts/session/index.phtml b/application/views/scripts/session/index.phtml index f98fa48..0ff255d 100644 --- a/application/views/scripts/session/index.phtml +++ b/application/views/scripts/session/index.phtml @@ -22,22 +22,22 @@ escape($session->getTime()) ?> escape($session->getIp()) ?> escape($session->getIp6()) ?> - url( array( 'controller' => 'session', 'action' => 'editsession', 'sessionID' => $session->getID() ), 'default', - true) ?>">edit filter - Edit Filter + delete filter + true) ?>">Delete Filter -- cgit v1.2.3-55-g7522 From 3d04fb75a980dba20e51dc91afd49f0eb9ee43fe Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 9 Mar 2011 16:31:58 +0100 Subject: Form-Verhalten geändert & Datenbank korrigiert --- application/controllers/ClientController.php | 21 +++----- application/controllers/FilterController.php | 78 +++++++++++----------------- application/controllers/PoolController.php | 20 +++---- application/forms/FilterAdd.php | 24 +++++---- application/views/scripts/filter/index.phtml | 11 ++-- application/views/scripts/pool/index.phtml | 22 +++++--- pbs-data.sql | 6 ++- public/media/css/style.css | 5 +- 8 files changed, 91 insertions(+), 96 deletions(-) (limited to 'application/views/scripts') diff --git a/application/controllers/ClientController.php b/application/controllers/ClientController.php index ff663ba..580eb6e 100644 --- a/application/controllers/ClientController.php +++ b/application/controllers/ClientController.php @@ -16,16 +16,15 @@ class ClientController extends Zend_Controller_Action public function addclientAction() { - $mac = $this->_request->getParam('mac'); - $hh = $this->_request->getParam('hh'); + $mac = $this->_request->getParam('mac'); + $hh = $this->_request->getParam('hh'); if (!isset($_POST["add"])){ - $addclient = new Application_Form_Client(); - $this->view->addclient = $addclient; + $addclient = new Application_Form_Client(); + $this->view->addclient = $addclient; } else{ $addfilterform = new Application_Form_Client($_POST); - print_a($_POST,$addfilterform->isValid($_POST)); if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) { $client = new Application_Model_Client(); $mac = ($mac!='')?$mac:$_POST['macadress']; @@ -37,9 +36,7 @@ class ClientController extends Zend_Controller_Action print_a('inserted'); $this->_redirect('/client'); } - else{ - print_a('no insert'); - } + $this->view->addclient = $addclient; } } @@ -69,8 +66,8 @@ class ClientController extends Zend_Controller_Action $this->view->editclient = $editclient; } else{ - $addfilterform = new Application_Form_Client($_POST); - if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) { + $editclient = new Application_Form_Client($_POST); + if ($editclient->isValid($_POST) || ($mac != '' && $hh != '') ) { $client = new Application_Model_Client($_POST); $client->setID($this->_request->getParam('clientID')); $clientmapper = new Application_Model_ClientMapper(); @@ -78,9 +75,7 @@ class ClientController extends Zend_Controller_Action print_a('updated'); $this->_redirect('/client'); } - else{ - print_a('no update'); - } + $this->view->editclient = $editclient; } } diff --git a/application/controllers/FilterController.php b/application/controllers/FilterController.php index 54bcb19..2853706 100644 --- a/application/controllers/FilterController.php +++ b/application/controllers/FilterController.php @@ -19,27 +19,27 @@ class FilterController extends Zend_Controller_Action public function indexAction() { try{ - $this->_filtermapper = new Application_Model_FilterMapper(); - $this->view->filters = $this->_filtermapper->fetchAll(); + $this->_filtermapper = new Application_Model_FilterMapper(); + $this->view->filters = $this->_filtermapper->fetchAll(); }catch (Zend_Exception $e) { - echo "Error message 2: " . $e->getMessage() . "\n"; + echo "Error message 2: " . $e->getMessage() . "\n"; } } public function addfilterAction() { - if (!isset($_POST["add"])){ - $addfilterform = new Application_Form_FilterAdd(); - $this->view->addfilterform = $addfilterform; + $bmmapper = new Application_Model_BootMenuMapper(); + //TODO get bootmenu by group + $bootmenus = $bmmapper->fetchAll(); + if (!isset($_POST["add"])){ + $addfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus)); + $this->view->addfilterform = $addfilterform; }else { - $addfilterform = new Application_Form_FilterAdd($_POST); + $addfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus),$_POST); if ($addfilterform->isValid($_POST)) { try{ - $newfilter = new Application_Model_Filter(); - $newfilter->setTitle($_POST['title']); + $newfilter = new Application_Model_Filter($_POST); $newfilter->setCreated(time()); - $newfilter->setDescription($_POST['description']); - $newfilter->setPriority($_POST['priority']); // TODO: Ändere mit ACL $newfilter->setGroupID('1'); @@ -54,6 +54,7 @@ class FilterController extends Zend_Controller_Action echo "Error message 2: " . $e->getMessage() . "\n"; } } + $this->view->addfilterform = $addfilterform; } } @@ -73,6 +74,9 @@ class FilterController extends Zend_Controller_Action public function editfilterAction() { + $bmmapper = new Application_Model_BootMenuMapper(); + //TODO get bootmenu by group + $bootmenus = $bmmapper->fetchAll(); if (!isset($_POST["add"])){ // TODO: ACL implementieren ob er editieren darf $filterID = $this->_request->getParam('filterID'); @@ -83,7 +87,7 @@ class FilterController extends Zend_Controller_Action $filtermapper->find($filterID,$filter); $filter2 = $filter->toArray(); - $editfilterform = new Application_Form_FilterAdd(); + $editfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus)); $editfilterform->populate($filter2); $this->view->editfilterform = $editfilterform; @@ -91,7 +95,7 @@ class FilterController extends Zend_Controller_Action try{ $filterID = $this->_request->getParam('filterID'); - $editfilterform = new Application_Form_FilterAdd($_POST); + $editfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus),$_POST); //TODO: ACL integrieren $_POST['groupID'] = 1; $_POST['membershipID'] = 1; @@ -102,16 +106,13 @@ class FilterController extends Zend_Controller_Action $newfilterenty->setID($this->_request->getParam('filterID')); $newfilter2 = new Application_Model_FilterMapper(); $newfilter2->save($newfilterenty); - echo 'valid'; - } - else - { - echo 'not valid'; - } + echo 'valid'; + $this->_redirect('/filter'); + } + $this->view->editfilterform = $editfilterform; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } - $this->_redirect('/filter'); } } @@ -120,23 +121,15 @@ class FilterController extends Zend_Controller_Action // TODO: ACL implementieren ob er editieren darf if (!isset($_POST["add"])){ - echo "case1"; try{ $editfilterform = new Application_Form_FilterEntriesAdd(array('filterID' => $this->_request->getParam('filterID'))); $this->view->editfilterform = $editfilterform; - echo "
";
-				print_r(array('debug','case1'));
-				echo "
"; - }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } } else{ - $editfilterform = new Application_Form_FilterEntriesAdd($_POST); - echo "
case2
"; - - if ($editfilterform->isValid($_POST)) { - echo "
case 2.2
"; + $editfilterform = new Application_Form_FilterEntriesAdd($_POST); + if ($editfilterform->isValid($_POST)) { $newfilterenty = new Application_Model_FilterEntries(); $newfilterenty->setFilterID($_POST['filterID']); $newfilterenty->setFiltertypeID($_POST['filtertypeID']); @@ -151,12 +144,10 @@ class FilterController extends Zend_Controller_Action } $newfilter2 = new Application_Model_FilterEntriesMapper(); - echo "
";
-				print_r($newfilterenty);
-				echo "
"; $newfilter2->save($newfilterenty); + $this->_redirect('/filter'); } - $this->_redirect('/filter'); + $this->view->editfilterform = $editfilterform; } } public function editfilterentryAction() @@ -174,13 +165,9 @@ class FilterController extends Zend_Controller_Action $editfilterform = new Application_Form_FilterEntriesAdd(); - echo "
";
-				print_r($filterentry->toArray());
-				echo "
"; $editfilterform->populate($filterentry->toArray()); $editfilterform->setFilterID($filterID); $this->view->editfilterform = $editfilterform; - echo "case 1.1"; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; @@ -189,8 +176,7 @@ class FilterController extends Zend_Controller_Action try{ $filterentriesID = $this->_request->getParam('filterentriesID'); $editfilterform = new Application_Form_FilterEntriesAdd($_POST); - if ($editfilterform->isValid($_POST)) { - echo "valid\n"; + if ($editfilterform->isValid($_POST)) { $newfilterenty = new Application_Model_FilterEntries($_POST); $newfilterenty->setID($filterentriesID); if($_POST['filtertypeID'] == 1){ @@ -201,20 +187,15 @@ class FilterController extends Zend_Controller_Action $newfilterenty->setFiltervalue($_POST['filtervalue']); $newfilterenty->setFiltervalue2($_POST['filtervalue2']); } - echo "
";
-					print_r($newfilterenty);
-					echo "
"; $newfilter2 = new Application_Model_FilterEntriesMapper(); $newfilter2->save($newfilterenty); + $this->_redirect('/filter'); } - else{ - echo 'nö'; - } + $this->view->editfilterform = $editfilterform; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } - $this->_redirect('/filter'); } } public function removefilterentryAction() @@ -260,8 +241,7 @@ class FilterController extends Zend_Controller_Action public function evaluateAction(){ $db = $this->db; $showPartResults = false; - try{ - + try{ $mysession = '1'; $filtertypID = 8; diff --git a/application/controllers/PoolController.php b/application/controllers/PoolController.php index cb38a80..7c5092e 100644 --- a/application/controllers/PoolController.php +++ b/application/controllers/PoolController.php @@ -25,7 +25,6 @@ class PoolController extends Zend_Controller_Action $assignedclientsArray[] = $c->toArray(); } $freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray); - #print_a($freeclients); $this->view->freeclients = $freeclients; @@ -49,6 +48,7 @@ class PoolController extends Zend_Controller_Action echo "Error message 2: " . $e->getMessage() . "\n"; } } + $this->view->addpool = $addfilterform; } } @@ -80,8 +80,8 @@ class PoolController extends Zend_Controller_Action $this->view->editpoolform = $editpool; }else { - $addpoolform = new Application_Form_Pool($_POST); - if ($addpoolform->isValid($_POST)) { + $editpoolform = new Application_Form_Pool($_POST); + if ($editpoolform->isValid($_POST)) { try{ $pool = new Application_Model_Pool($_POST); $pool->setID($this->_request->getParam('poolID')); @@ -92,6 +92,7 @@ class PoolController extends Zend_Controller_Action echo "Error message 2: " . $e->getMessage() . "\n"; } } + $this->view->editpoolform = $editpoolform; } } @@ -99,10 +100,8 @@ class PoolController extends Zend_Controller_Action { $clientID = $this->_request->getParam('clientID'); $poolID = $this->_request->getParam('poolID'); - print_a($clientID,$poolID); if(!isset($_POST['clientID']) && ($clientID == '' && $poolID == '')){ - print_a($_POST); $clientmapper = new Application_Model_ClientMapper(); $clients = $clientmapper->fetchAll(); foreach($clients as $c){ @@ -117,10 +116,8 @@ class PoolController extends Zend_Controller_Action $poolclient = new Application_Form_PoolClient(array('clients'=> $freeclients)); $this->view->poolclient = $poolclient; - }else { - #$_POST['poolID'] = $this->_request->getParam('poolID'); - $poolclientform = new Application_Form_PoolClient($_POST); - + }else { + $poolclient = new Application_Form_PoolClient($_POST); try{ $pool = new Application_Model_PoolEntries($_POST); $pool->setPoolID($this->_request->getParam('poolID')); @@ -133,6 +130,7 @@ class PoolController extends Zend_Controller_Action }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } + $this->view->poolclient = $poolclient; } } @@ -156,15 +154,11 @@ class PoolController extends Zend_Controller_Action if(is_numeric($poolentriesID)){ $deletepoolentries = new Application_Model_PoolEntries(); $deletepoolentries->setID($poolentriesID); - echo "
";
-				print_r($deletepoolentries);
-				echo "
"; $deletepoolentriesmapper = new Application_Model_PoolEntriesMapper(); $deletepoolentriesmapper->delete($deletepoolentries); echo "ok"; } -# echo "ready"; $this->_redirect('/pool'); } diff --git a/application/forms/FilterAdd.php b/application/forms/FilterAdd.php index af4f9b2..091eb37 100644 --- a/application/forms/FilterAdd.php +++ b/application/forms/FilterAdd.php @@ -2,6 +2,7 @@ class Application_Form_FilterAdd extends Zend_Form { + private $bootmenus; public function init() { @@ -22,14 +23,16 @@ class Application_Form_FilterAdd extends Zend_Form 'label' => 'Description:', )); - $this->addElement('text', 'bootmenuID', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'label' => 'bootmenuID:', - )); + $bootmenufield = $this->createElement('select','bootmenuID'); + $bootmenufield ->setLabel('Bootmenu:'); + + if(count($this->bootmenus)>0){ + foreach($this->bootmenus as $id => $g){ + $bootmenufield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootmenufield->setRegisterInArrayValidator(false); + $this->addElement($bootmenufield); $this->addElement('text', 'priority', array( 'filters' => array('StringTrim'), @@ -45,7 +48,10 @@ class Application_Form_FilterAdd extends Zend_Form 'label' => 'Save', )); } - + function setBootmenus($val){ + $this->bootmenus = $val; + return; + } } diff --git a/application/views/scripts/filter/index.phtml b/application/views/scripts/filter/index.phtml index 6f98b4c..a3d3efa 100644 --- a/application/views/scripts/filter/index.phtml +++ b/application/views/scripts/filter/index.phtml @@ -43,13 +43,17 @@ 'default', true) ?>">Add Filterentry + findBy('filterID',$filter->getID())); + $erg = $fe->findBy('filterID',$filter->getID()); + ?> + 0): ?> ↳ findBy('filterID',$filter->getID())); - $erg = $fe->findBy('filterID',$filter->getID()); + ?> @@ -96,6 +100,7 @@
+ diff --git a/application/views/scripts/pool/index.phtml b/application/views/scripts/pool/index.phtml index f89dbc9..2c6ba16 100644 --- a/application/views/scripts/pool/index.phtml +++ b/application/views/scripts/pool/index.phtml @@ -43,6 +43,11 @@ 'default', true) ?>">Link Client + findBy('poolID',$pool->getID()); + ?> + 0): ?> ↳ @@ -54,8 +59,6 @@ Actions findBy('poolID',$pool->getID()); foreach ($clients as $client): ?> @@ -77,14 +80,18 @@ + + +

Free clients

- -pools as $pool): ?> - - + + + + +freeclients as $client): ?> @@ -92,7 +99,8 @@ foreach ($this->freeclients as $client): ?> - + @@ -16,6 +17,7 @@ +
ClientIDMacAdressHardwarehashescape($pool->getTitle()) ?>
ClientIDMacAdressHardwarehashActions
ID TitleDescription Priority TargetBootMenu Actions
escape($filter->getID()) ?> escape($filter->title) ?>escape($filter->Description) ?> escape($filter->priority) ?> escape($filter->bootmenuID) ?> url( diff --git a/pbs-newdata.sql b/pbs-newdata.sql new file mode 100644 index 0000000..48a1dc6 --- /dev/null +++ b/pbs-newdata.sql @@ -0,0 +1,125 @@ +USE pbs; +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + +-- Adding person test//test +INSERT INTO `pbs_person` (`personID`, `title`, `name`, `firstname`, `street`, `housenumber`, `city`, `postalcode`, `logindate`, `registerdate`, `email`, `login`, `password`, `password_salt`) VALUES +(1, 'Herr', 'Test 1', 'Test 1', 'Teststr,', '5', 'Testburg', '1337', NULL, '1299612370', 'test', NULL, '4207acba08cadccc397e2302a55b339a', 'f21ee663b17bcefc6868694dffda602a'); +-- Adding person test2//test +INSERT INTO `pbs_person` (`personID`, `title`, `name`, `firstname`, `street`, `housenumber`, `city`, `postalcode`, `logindate`, `registerdate`, `email`, `login`, `password`, `password_salt`) VALUES +(2, 'Herr', 'Test 2', 'Test 2', 'Teststr,', '5', 'Testburg', '1337', NULL, '1299612370', 'test2', NULL, '4207acba08cadccc397e2302a55b339a', 'f21ee663b17bcefc6868694dffda602a'); + +-- Adding group +INSERT INTO `pbs`.`pbs_group` (`groupID` ,`title` ,`description`)VALUES (1 , 'Group 1', NULL); + +-- Adding role +INSERT INTO `pbs`.`pbs_role` (`roleID`, `groupID`, `title`, `description`) VALUES (1, '1', 'Role 1', NULL); +INSERT INTO `pbs`.`pbs_role` (`roleID`, `groupID`, `title`, `description`) VALUES (2, '1', 'Role 2', NULL); + +-- Adding memberships +INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`) VALUES (1, '1', '1', '1'); +INSERT INTO `pbs`.`pbs_membership` (`membershipID`, `groupID`, `roleID`, `personID`) VALUES (2, '1', '2', '2'); + +-- Adding clients +INSERT INTO `pbs_client` (`clientID`, `macadress`, `hardwarehash`) VALUES +(1, '00:00:00:00:00:10', 'ea9b82d9de911bc2d3cd23f53a6cab48'), +(2, '00:00:00:00:10:00', '1e2b1599710fbbef0dc789e8cfe12455'), +(3, '00:00:00:10:10:00', '8f6209ca3d6b35e223a11c249d1b69fc'), +(4, '00:00:10:00:00:00', 'e17ab09f3586464f19629e2e8b1e9a9d'), +(5, '00:10:00:00:00:00', '9bf70279d283b85440c2031c19bb6812'), +(6, '10:00:00:00:00:00', 'ad3bce4464a6267441ec144744439c7e'), +(7, '00:55:00:55:00:55', 'e8d7e80d79f224771b7a3a0af4e02748'), +(8, '66:00:66:00:66:00', 'ded66ce272f384e9e386c1b57ded3e4d'), +(9, '00:ff:ff:ff:ff:ff', '695610ee509c060b1fca9c8011529af4'), +(10, '00:22:00:22:00:22', 'a3562c8cad2a4fa4fc11656025dc911b'); + +-- Adding config +INSERT INTO `pbs_config` (`configID`, `title`, `groupID`, `membershipID`, `shellscript`, `created`) VALUES +(1, 'Config 1', 1, 1, 'shellscript 1', '1299693677'), +(2, 'Config 2', 1, 1, 'shellskript 2', '1299693690'), +(3, 'Config 3', 1, 1, 'shellskript 3', '1299693690'), +(4, 'Config 4', 1, 1, 'shellskript 4', '1299693690'), +(5, 'Config 5', 1, 1, 'shellskript 5', '1299693690'); + +-- Adding bootos +INSERT INTO `pbs_bootos` (`bootosID`, `configID`, `groupID`, `membershipID`, `title`, `description`, `path_init`, `path_kernel`, `defaultkcl`, `created`, `expires`, `public`) VALUES +(1, 1, 1, 1, 'BootOs 1', 'Description 1', 'initpath 1', 'kernelpath 1', 'default kcl 1', '1299693782', '2012-03-09', 0), +(2, 1, 1, 1, 'BootOs 2', 'Description 2', 'initpath 2', 'kernelpath 2', 'default kcl 2', '1299693782', '2012-03-09', 0), +(3, 1, 1, 1, 'BootOs 3', 'Description 3', 'initpath 3', 'kernelpath 3', 'default kcl 3', '1299693782', '2012-03-09', 0), +(4, 1, 1, 1, 'BootOs 4', 'Description 4', 'initpath 4', 'kernelpath 4', 'default kcl 4', '1299693782', '2012-03-09', 0), +(5, 1, 1, 1, 'BootOs 5', 'Description 5', 'initpath 5', 'kernelpath 5', 'default kcl 5', '1299693782', '2012-03-09', 0), +(6, 1, 1, 1, 'BootOs 6', 'Description 6', 'initpath 6', 'kernelpath 6', 'default kcl 6', '1299693782', '2012-03-09', 0), +(7, 1, 1, 1, 'BootOs 7', 'Description 7', 'initpath 7', 'kernelpath 7', 'default kcl 7', '1299693782', '2012-03-09', 0), +(8, 1, 1, 1, 'BootOs 8', 'Description 8', 'initpath 8', 'kernelpath 8', 'default kcl 8', '1299693782', '2012-03-09', 0), +(9, 1, 1, 1, 'BootOs 9', 'Description 9', 'initpath 9', 'kernelpath 9', 'default kcl 9', '1299693782', '2012-03-09', 0), +(10, 1, 1, 1, 'BootOs 10', 'Description 10', 'initpath 10', 'kernelpath 10', 'default kcl 10', '1299693782', '2012-03-09', 0); + +-- Adding bootiso +INSERT INTO `pbs_bootiso` (`bootisoID`, `title`, `membershipID`, `groupID`, `path`, `serialnumber`, `created`, `expires`, `public`) VALUES +(1, 'BootIso 1', 1, 1, 'Path 1', 123456789, '1299693879', '2012-03-09', 0), +(2, 'BootIso 2', 1, 1, 'Path 2', 2147483647, '1299693899', '2012-03-09', 0), +(3, 'BootIso 3', 1, 1, 'Path 3', 2147483647, '1299693899', '2012-03-09', 0); + +-- Adding Pools +INSERT INTO `pbs_pool` (`poolID`, `title`, `description`, `location`) VALUES +(1, 'Pool 1', 'Description 1', 'Keller'), +(2, 'Pool 2', 'Description 2', 'EG'), +(3, 'Pool 3', 'Description 3', '1 OG'), +(4, 'Pool 4', 'Description', '2 OG'); + +-- Adding BootOs to BootMenus +INSERT INTO `pbs_bootmenuentries` (`bootmenuentriesID`, `bootosID`, `bootmenuID`, `title`, `kcl`, `configID`, `order`) VALUES +(1, 1, 1, 'Select BootOs 1', 'kcl 1', 1, 0), +(2, 1, 1, 'Select BootOs 1', 'kcl 2', 2, 1), +(3, 2, 1, 'Select BootOs 2', 'kcl 3', 2, 2), +(4, 5, 2, 'Select BootOs 5', 'kcl 5', 2, 0), +(5, 4, 2, 'Select BootOs 4', 'kcl 4', 2, 1), +(6, 10, 3, 'Select BootOs 10', 'kcl 10', 3, 0), +(7, 8, 3, 'Select BootOs 8', 'kcl 8', 4, 1), +(8, 1, 2, 'Select BootOs 7', 'kcl 7', 5, 2), +(9, 1, 5, 'Select BootOs 3', 'kcl 3', 4, 0), +(10, 9, 4, 'Select BootOs 9', 'kcl 9', 3, 0), +(11, 7, 4, 'Select BootOs 7', 'kcl 7', 5, 1); + +-- Adding client to pools (poolentries) +INSERT INTO `pbs_poolentries` (`poolentriesID`, `poolID`, `clientID`) VALUES +(1, 1, 1), +(2, 1, 2), +(3, 1, 3), +(4, 1, 4), +(5, 2, 5), +(6, 2, 6), +(7, 3, 7), +(8, 3, 8), +(9, 4, 9), +(10, 4, 10); + +-- Adding Bootmenus +INSERT INTO `pbs_bootmenu` (`bootmenuID`, `membershipID`, `groupID`, `title`, `created`) VALUES +(1, 1, 1, 'Bootmenu 1', '1299694422'), +(2, 1, 1, 'Bootmenu 2', '1299694433'), +(3, 1, 1, 'Bootmenu 3', '1299694441'), +(4, 1, 1, 'Bootmenu 4', '1299694454'), +(5, 1, 1, 'Bootmenu 5', '1299694461'); + +-- Adding Sessions +INSERT INTO `pbs_session` (`sessionID`, `clientID`, `bootosID`, `bootisoID`, `time`, `ip`, `ip6`) VALUES +(1, 1, NULL, 1, '1299684000', '132.230.5.6', ''), +(2, 9, NULL, 2, '1299684000', '132.230.10.2', ''), +(3, 10, NULL, 1, '1299648000', '132.20.20.2', ''), +(4, 7, NULL, 3, '1299676800', '84.23.56.86', ''), +(5, 4, NULL, 3, '1299674340', '70.81.94.222', ''), +(6, 5, NULL, 3, '1299683100', '210.84.65.2', ''); + +-- Adding Filter +INSERT INTO `pbs_filter` (`filterID`, `membershipID`, `groupID`, `bootmenuID`, `title`, `description`, `created`, `priority`) VALUES +(1, 1, 1, 1, 'Filter 1', 'Innerhalb der Uni', '1299697337', 10), +(2, 1, 1, 5, 'Filter 2', 'Ausserhalb der Uni', '1299697073', 20), +(3, 1, 1, 4, 'Filter 3', 'Desc3', '1299697277', 5); + +-- Adding Filterentries +INSERT INTO `pbs_filterentries` (`filterentriesID`, `filterID`, `filtertypeID`, `filtervalue`, `filtervalue2`) VALUES +(1, 1, 7, '08-00', '18-00'), +(2, 2, 1, '001.001.001.001', '132.229.255.255'), +(3, 2, 1, '132.231.001.001', '255.255.255.255'), +(4, 1, 1, '132.230.001.001', '132.230.255.255'), +(5, 3, 3, '1', ''); diff --git a/pbs.sql b/pbs.sql index a4149c2..f404b0a 100644 --- a/pbs.sql +++ b/pbs.sql @@ -204,8 +204,8 @@ CREATE TABLE IF NOT EXISTS `pbs_client` ( CREATE TABLE IF NOT EXISTS `pbs_session` ( `sessionID` int(11) NOT NULL AUTO_INCREMENT, - `clientID` int(11) NOT NULL, - `bootosID` int(11) NOT NULL, + `clientID` int(11), + `bootosID` int(11), `time` varchar(14) NOT NULL, `ip` varchar(15) NOT NULL, `ip6` varchar(45), @@ -303,5 +303,14 @@ ALTER TABLE `pbs_filterentries` ADD CONSTRAINT `pbs_filterentries_ibfk_2` FOREIGN KEY (`filtertypeID`) REFERENCES `pbs_filtertype` (`filtertypeID`) ON DELETE CASCADE; +-- Insert Filtertypes +INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'IP'); +INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'MAC'); +INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'PoolID'); +INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'BootIso'); +INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'Membership'); +INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'Group'); +INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'Time'); +INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'Client'); diff --git a/public/media/css/style.css b/public/media/css/style.css index 345ba12..1d3da5d 100644 --- a/public/media/css/style.css +++ b/public/media/css/style.css @@ -85,6 +85,9 @@ border:1px solid #CCC; .addbutton { float:right; } +.addbutton:before{ + content: url(/media/img/create.png)' '; +} .monospace { font-family:Courier New, monospace; diff --git a/zend-user.sh b/zend-user.sh index 6e4bbeb..16ba63e 100644 --- a/zend-user.sh +++ b/zend-user.sh @@ -1,4 +1,4 @@ #!/bin/bash -cp ~/pbs2/application/configs/application.ini /tmp/pbs2/application/configs/application.ini -mysql -u root -p < /tmp/pbs2/pbs.sql -mysql -u root -p < /tmp/pbs2/pbs-data.sql +cp /tmp/pbs2/application/configs/application.ini.dist /tmp/pbs2/application/configs/application.ini +mysql -u root -p