From b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 14 Mar 2011 16:09:03 +0100 Subject: Application in 3 Modules gesplittet, Dev = unsere entwicklungsumgebung, user = die weboberfläche fr anwender mit acl etc, fbgui = für die fbgui truppe - links in dev müssen noch angepasst werden --- .../modules/dev/controllers/AuthController.php | 169 +++++ .../modules/dev/controllers/BootisoController.php | 125 ++++ .../modules/dev/controllers/BootmenuController.php | 328 ++++++++++ .../modules/dev/controllers/BootosController.php | 147 +++++ .../modules/dev/controllers/ClientController.php | 90 +++ .../modules/dev/controllers/ConfigController.php | 126 ++++ .../modules/dev/controllers/ErrorController.php | 51 ++ .../modules/dev/controllers/FilterController.php | 680 +++++++++++++++++++++ .../modules/dev/controllers/GroupController.php | 242 ++++++++ .../modules/dev/controllers/IndexController.php | 22 + .../modules/dev/controllers/PersonController.php | 154 +++++ .../modules/dev/controllers/PoolController.php | 176 ++++++ .../modules/dev/controllers/ResourceController.php | 192 ++++++ .../modules/dev/controllers/RoleController.php | 64 ++ .../modules/dev/controllers/SessionController.php | 182 ++++++ application/modules/dev/forms/AuthDelete.php | 28 + application/modules/dev/forms/AuthLogin.php | 38 ++ .../modules/dev/forms/AuthRecoverPassword.php | 28 + application/modules/dev/forms/AuthRegister.php | 105 ++++ application/modules/dev/forms/BootisoCreate.php | 94 +++ application/modules/dev/forms/BootisoEdit.php | 92 +++ application/modules/dev/forms/BootmenuCreate.php | 51 ++ application/modules/dev/forms/BootmenuEdit.php | 51 ++ .../modules/dev/forms/BootmenuEntriesAdd.php | 110 ++++ .../modules/dev/forms/BootmenuEntriesEdit.php | 108 ++++ application/modules/dev/forms/BootosCreate.php | 135 ++++ application/modules/dev/forms/BootosEdit.php | 145 +++++ application/modules/dev/forms/Client.php | 45 ++ application/modules/dev/forms/ConfigCreate.php | 63 ++ application/modules/dev/forms/ConfigEdit.php | 62 ++ application/modules/dev/forms/FilterAdd.php | 65 ++ application/modules/dev/forms/FilterEntriesAdd.php | 145 +++++ application/modules/dev/forms/FilterEvaluate.php | 130 ++++ application/modules/dev/forms/GroupAdd.php | 65 ++ application/modules/dev/forms/GroupEdit.php | 52 ++ application/modules/dev/forms/GroupLink.php | 55 ++ application/modules/dev/forms/GroupRequest.php | 42 ++ application/modules/dev/forms/PersonEdit.php | 117 ++++ application/modules/dev/forms/Pool.php | 52 ++ application/modules/dev/forms/PoolClient.php | 32 + application/modules/dev/forms/Session.php | 139 +++++ .../modules/dev/views/scripts/auth/delete.phtml | 0 .../modules/dev/views/scripts/auth/index.phtml | 0 .../modules/dev/views/scripts/auth/login.phtml | 5 + .../modules/dev/views/scripts/auth/logout.phtml | 1 + .../dev/views/scripts/auth/recoverpassword.phtml | 4 + .../modules/dev/views/scripts/auth/register.phtml | 4 + .../dev/views/scripts/bootiso/createbootiso.phtml | 4 + .../dev/views/scripts/bootiso/editbootiso.phtml | 4 + .../modules/dev/views/scripts/bootiso/index.phtml | 56 ++ .../views/scripts/bootmenu/addbootmenuentry.phtml | 4 + .../views/scripts/bootmenu/createbootmenu.phtml | 4 + .../dev/views/scripts/bootmenu/editbootmenu.phtml | 4 + .../views/scripts/bootmenu/editbootmenuentry.phtml | 4 + .../modules/dev/views/scripts/bootmenu/index.phtml | 119 ++++ .../dev/views/scripts/bootos/createbootos.phtml | 4 + .../dev/views/scripts/bootos/editbootos.phtml | 4 + .../modules/dev/views/scripts/bootos/index.phtml | 62 ++ .../dev/views/scripts/client/addclient.phtml | 3 + .../dev/views/scripts/client/editclient.phtml | 3 + .../modules/dev/views/scripts/client/index.phtml | 44 ++ .../dev/views/scripts/client/removeclient.phtml | 1 + .../dev/views/scripts/config/createconfig.phtml | 4 + .../dev/views/scripts/config/editconfig.phtml | 4 + .../modules/dev/views/scripts/config/index.phtml | 50 ++ .../modules/dev/views/scripts/error/error.phtml | 28 + .../dev/views/scripts/filter/addfilter.phtml | 3 + .../dev/views/scripts/filter/addfilterentry.phtml | 3 + .../dev/views/scripts/filter/editfilter.phtml | 8 + .../dev/views/scripts/filter/editfilterentry.phtml | 2 + .../dev/views/scripts/filter/evaluate.phtml | 0 .../modules/dev/views/scripts/filter/index.phtml | 117 ++++ .../dev/views/scripts/filter/testevaluate.phtml | 4 + .../modules/dev/views/scripts/group/add.phtml | 4 + .../modules/dev/views/scripts/group/delete.phtml | 6 + .../modules/dev/views/scripts/group/edit.phtml | 10 + .../dev/views/scripts/group/grantperson.phtml | 11 + .../modules/dev/views/scripts/group/index.phtml | 35 ++ .../modules/dev/views/scripts/group/link.phtml | 4 + .../dev/views/scripts/group/revokeperson.phtml | 6 + .../modules/dev/views/scripts/group/show.phtml | 122 ++++ .../modules/dev/views/scripts/index/index.phtml | 1 + .../modules/dev/views/scripts/person/edit.phtml | 4 + .../modules/dev/views/scripts/person/index.phtml | 0 .../modules/dev/views/scripts/person/leave.phtml | 6 + .../modules/dev/views/scripts/person/request.phtml | 6 + .../modules/dev/views/scripts/person/show.phtml | 79 +++ .../dev/views/scripts/pool/createpool.phtml | 2 + .../dev/views/scripts/pool/deletepool.phtml | 1 + .../modules/dev/views/scripts/pool/editpool.phtml | 4 + .../modules/dev/views/scripts/pool/index.phtml | 126 ++++ .../dev/views/scripts/pool/linkclient.phtml | 3 + .../dev/views/scripts/pool/unlinkclient.phtml | 1 + .../scripts/resource/get-bootmenu-entry.phtml | 0 .../modules/dev/views/scripts/resource/index.phtml | 0 .../modules/dev/views/scripts/role/add.phtml | 1 + .../modules/dev/views/scripts/role/delete.phtml | 1 + .../modules/dev/views/scripts/role/edit.phtml | 1 + .../modules/dev/views/scripts/role/index.phtml | 1 + .../modules/dev/views/scripts/role/linkright.phtml | 1 + .../modules/dev/views/scripts/role/show.phtml | 1 + .../dev/views/scripts/role/unlinkright.phtml | 1 + .../dev/views/scripts/session/createsession.phtml | 5 + .../dev/views/scripts/session/deletesession.phtml | 1 + .../dev/views/scripts/session/editsession.phtml | 5 + .../modules/dev/views/scripts/session/index.phtml | 49 ++ 106 files changed, 5852 insertions(+) create mode 100644 application/modules/dev/controllers/AuthController.php create mode 100644 application/modules/dev/controllers/BootisoController.php create mode 100644 application/modules/dev/controllers/BootmenuController.php create mode 100644 application/modules/dev/controllers/BootosController.php create mode 100644 application/modules/dev/controllers/ClientController.php create mode 100644 application/modules/dev/controllers/ConfigController.php create mode 100644 application/modules/dev/controllers/ErrorController.php create mode 100644 application/modules/dev/controllers/FilterController.php create mode 100644 application/modules/dev/controllers/GroupController.php create mode 100644 application/modules/dev/controllers/IndexController.php create mode 100644 application/modules/dev/controllers/PersonController.php create mode 100644 application/modules/dev/controllers/PoolController.php create mode 100644 application/modules/dev/controllers/ResourceController.php create mode 100644 application/modules/dev/controllers/RoleController.php create mode 100644 application/modules/dev/controllers/SessionController.php create mode 100644 application/modules/dev/forms/AuthDelete.php create mode 100644 application/modules/dev/forms/AuthLogin.php create mode 100644 application/modules/dev/forms/AuthRecoverPassword.php create mode 100644 application/modules/dev/forms/AuthRegister.php create mode 100644 application/modules/dev/forms/BootisoCreate.php create mode 100644 application/modules/dev/forms/BootisoEdit.php create mode 100644 application/modules/dev/forms/BootmenuCreate.php create mode 100644 application/modules/dev/forms/BootmenuEdit.php create mode 100644 application/modules/dev/forms/BootmenuEntriesAdd.php create mode 100644 application/modules/dev/forms/BootmenuEntriesEdit.php create mode 100644 application/modules/dev/forms/BootosCreate.php create mode 100644 application/modules/dev/forms/BootosEdit.php create mode 100644 application/modules/dev/forms/Client.php create mode 100644 application/modules/dev/forms/ConfigCreate.php create mode 100644 application/modules/dev/forms/ConfigEdit.php create mode 100644 application/modules/dev/forms/FilterAdd.php create mode 100644 application/modules/dev/forms/FilterEntriesAdd.php create mode 100644 application/modules/dev/forms/FilterEvaluate.php create mode 100644 application/modules/dev/forms/GroupAdd.php create mode 100644 application/modules/dev/forms/GroupEdit.php create mode 100644 application/modules/dev/forms/GroupLink.php create mode 100644 application/modules/dev/forms/GroupRequest.php create mode 100644 application/modules/dev/forms/PersonEdit.php create mode 100644 application/modules/dev/forms/Pool.php create mode 100644 application/modules/dev/forms/PoolClient.php create mode 100644 application/modules/dev/forms/Session.php create mode 100644 application/modules/dev/views/scripts/auth/delete.phtml create mode 100644 application/modules/dev/views/scripts/auth/index.phtml create mode 100644 application/modules/dev/views/scripts/auth/login.phtml create mode 100644 application/modules/dev/views/scripts/auth/logout.phtml create mode 100644 application/modules/dev/views/scripts/auth/recoverpassword.phtml create mode 100644 application/modules/dev/views/scripts/auth/register.phtml create mode 100644 application/modules/dev/views/scripts/bootiso/createbootiso.phtml create mode 100644 application/modules/dev/views/scripts/bootiso/editbootiso.phtml create mode 100644 application/modules/dev/views/scripts/bootiso/index.phtml create mode 100644 application/modules/dev/views/scripts/bootmenu/addbootmenuentry.phtml create mode 100644 application/modules/dev/views/scripts/bootmenu/createbootmenu.phtml create mode 100644 application/modules/dev/views/scripts/bootmenu/editbootmenu.phtml create mode 100644 application/modules/dev/views/scripts/bootmenu/editbootmenuentry.phtml create mode 100644 application/modules/dev/views/scripts/bootmenu/index.phtml create mode 100644 application/modules/dev/views/scripts/bootos/createbootos.phtml create mode 100644 application/modules/dev/views/scripts/bootos/editbootos.phtml create mode 100644 application/modules/dev/views/scripts/bootos/index.phtml create mode 100644 application/modules/dev/views/scripts/client/addclient.phtml create mode 100644 application/modules/dev/views/scripts/client/editclient.phtml create mode 100644 application/modules/dev/views/scripts/client/index.phtml create mode 100644 application/modules/dev/views/scripts/client/removeclient.phtml create mode 100644 application/modules/dev/views/scripts/config/createconfig.phtml create mode 100644 application/modules/dev/views/scripts/config/editconfig.phtml create mode 100644 application/modules/dev/views/scripts/config/index.phtml create mode 100644 application/modules/dev/views/scripts/error/error.phtml create mode 100644 application/modules/dev/views/scripts/filter/addfilter.phtml create mode 100644 application/modules/dev/views/scripts/filter/addfilterentry.phtml create mode 100644 application/modules/dev/views/scripts/filter/editfilter.phtml create mode 100644 application/modules/dev/views/scripts/filter/editfilterentry.phtml create mode 100644 application/modules/dev/views/scripts/filter/evaluate.phtml create mode 100644 application/modules/dev/views/scripts/filter/index.phtml create mode 100644 application/modules/dev/views/scripts/filter/testevaluate.phtml create mode 100644 application/modules/dev/views/scripts/group/add.phtml create mode 100644 application/modules/dev/views/scripts/group/delete.phtml create mode 100644 application/modules/dev/views/scripts/group/edit.phtml create mode 100644 application/modules/dev/views/scripts/group/grantperson.phtml create mode 100644 application/modules/dev/views/scripts/group/index.phtml create mode 100644 application/modules/dev/views/scripts/group/link.phtml create mode 100644 application/modules/dev/views/scripts/group/revokeperson.phtml create mode 100644 application/modules/dev/views/scripts/group/show.phtml create mode 100644 application/modules/dev/views/scripts/index/index.phtml create mode 100644 application/modules/dev/views/scripts/person/edit.phtml create mode 100644 application/modules/dev/views/scripts/person/index.phtml create mode 100644 application/modules/dev/views/scripts/person/leave.phtml create mode 100644 application/modules/dev/views/scripts/person/request.phtml create mode 100644 application/modules/dev/views/scripts/person/show.phtml create mode 100644 application/modules/dev/views/scripts/pool/createpool.phtml create mode 100644 application/modules/dev/views/scripts/pool/deletepool.phtml create mode 100644 application/modules/dev/views/scripts/pool/editpool.phtml create mode 100644 application/modules/dev/views/scripts/pool/index.phtml create mode 100644 application/modules/dev/views/scripts/pool/linkclient.phtml create mode 100644 application/modules/dev/views/scripts/pool/unlinkclient.phtml create mode 100644 application/modules/dev/views/scripts/resource/get-bootmenu-entry.phtml create mode 100644 application/modules/dev/views/scripts/resource/index.phtml create mode 100644 application/modules/dev/views/scripts/role/add.phtml create mode 100644 application/modules/dev/views/scripts/role/delete.phtml create mode 100644 application/modules/dev/views/scripts/role/edit.phtml create mode 100644 application/modules/dev/views/scripts/role/index.phtml create mode 100644 application/modules/dev/views/scripts/role/linkright.phtml create mode 100644 application/modules/dev/views/scripts/role/show.phtml create mode 100644 application/modules/dev/views/scripts/role/unlinkright.phtml create mode 100644 application/modules/dev/views/scripts/session/createsession.phtml create mode 100644 application/modules/dev/views/scripts/session/deletesession.phtml create mode 100644 application/modules/dev/views/scripts/session/editsession.phtml create mode 100644 application/modules/dev/views/scripts/session/index.phtml (limited to 'application/modules/dev') diff --git a/application/modules/dev/controllers/AuthController.php b/application/modules/dev/controllers/AuthController.php new file mode 100644 index 0000000..097417b --- /dev/null +++ b/application/modules/dev/controllers/AuthController.php @@ -0,0 +1,169 @@ +db = Zend_Db_Table::getDefaultAdapter(); + $this->personmapper = new Application_Model_PersonMapper(); + } + + public function indexAction() + { + $this->_helper->redirector('login', 'auth'); + } + + public function loginAction() + { + if (Zend_Auth::getInstance()->hasIdentity()) { + print_a('Already logged in.'); + } else { + if (!isset($_POST["login"])){ + $loginForm = new Application_Form_AuthLogin(); + } else { + $loginForm = new Application_Form_AuthLogin($_POST); + + if ($loginForm->isValid($_POST)) { + + $auth = Zend_Auth::getInstance(); + + $adapter = new Zend_Auth_Adapter_DbTable( + $this->db, + 'pbs_person', + 'email', + 'password', + 'MD5(CONCAT(?, password_salt))' + ); + + + $adapter->setIdentity($loginForm->getValue('email')); + $adapter->setCredential($loginForm->getValue('password')); + + $result = $auth->authenticate($adapter); + + // TODO: erweiterte fehlerbeschreibung des Users + + if ($result->isValid()) { + $this->personmapper = new Application_Model_PersonMapper(); + $result = $this->personmapper->findBy('email', Zend_Auth::getInstance()->getIdentity()); + $person = new Application_Model_Person($result[0]); + $person->setID($result[0]['personID']); + $date = new DateTime(); + $person->setLogindate($date->getTimestamp()); + $this->personmapper->save($person); + $this->_redirect('/'); + return; + } else { + echo "Wrong Email or Password."; + } + } + } + + $this->view->loginForm = $loginForm; + } + } + + public function registerAction() + { + if (Zend_Auth::getInstance()->hasIdentity()) { + print_a('Already logged in.'); + } else { + if (!isset($_POST["register"])){ + $registerForm = new Application_Form_AuthRegister(); + } else { + $registerForm = new Application_Form_AuthRegister($_POST); + + if ($registerForm->isValid($_POST)) { + + $person = new Application_Model_Person($_POST); + $this->personmapper = new Application_Model_PersonMapper(); + + $date = new DateTime(); + $person->setRegisterdate($date->getTimestamp()); + $person->setPasswordSalt(MD5($date->getTimestamp())); + $person->setPassword(MD5($person->getPassword() . $person->getPasswordSalt())); + print_a($person); + try { + $this->personmapper->save($person); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + echo "Email Address already existing.."; + return; + } + echo "Successfully registered.
"; + echo "Continue to Login: Login"; + $this->_helper->redirector('login', 'auth'); + return; + } + } + + $this->view->registerForm = $registerForm; + } + } + + public function logoutAction() + { + $auth = Zend_Auth::getInstance(); + $auth->clearIdentity(); + $this->_helper->redirector('login', 'auth'); + } + + public function recoverpasswordAction() + { + if (!isset($_POST["recoverPassword"])){ + $recoverPasswordForm = new Application_Form_AuthRecoverPassword(); + } else { + $recoverPasswordForm = new Application_Form_AuthRecoverPassword($_POST); + # Wiederherstellung funktioniert noch nicht!!! + /*if ($recoverPasswordForm->isValid($_POST)) { + $recoverPasswordForm->getView()->url(); + $person = new Application_Model_Person($_POST); + $this->personmapper = new Application_Model_PersonMapper(); + + $result = $this->personmapper->findBy('email', $_POST['email']); + $email = $result[0]['email']; + $name = $result[0]['firstname'] . ' ' . $result[0]['name']; + $url = $this->getRequest()->getScheme() . '://' . $this->getRequest()->getHttpHost() . $this->view->url(); + $recoverid = $this->random(100); + $mailbody = 'Um das Passwort zu ändern klicken Sie auf folgenden Link

Passwort ändern'; + $mail = new Zend_Mail(); + $mail->setBodyHtml($mailbody, 'utf8'); + $mail->getBodyHtml()->getContent(); + $mail->setFrom('admin@local', 'Admin'); + $mail->addTo($email, $name); + $mail->setSubject('Password Wiederherstellung Preboot Server'); + $mail->send(); + } + */ + } + + $this->view->recoverPasswordForm = $recoverPasswordForm; + } + + public function deleteAction() + { + $result = $this->personmapper->findBy('email', Zend_Auth::getInstance()->getIdentity()); + $person = $result[0]; + $personID = $person["personID"]; + if (isset($personID)){ + $this->personmapper = new Application_Model_PersonMapper(); + $person = $this->personmapper->find($personID); + try { + $this->personmapper->delete($person); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + $auth = Zend_Auth::getInstance(); + $auth->clearIdentity(); + $this->_helper->redirector('login', 'auth'); + } + } +} \ No newline at end of file diff --git a/application/modules/dev/controllers/BootisoController.php b/application/modules/dev/controllers/BootisoController.php new file mode 100644 index 0000000..078c962 --- /dev/null +++ b/application/modules/dev/controllers/BootisoController.php @@ -0,0 +1,125 @@ +view->bootisolist = $bootisomapper->fetchAll(); + + foreach ($this->view->bootisolist as $bootiso){ + $bootiso->setGroupID("[".$bootiso->getGroupID()."] ".$groupmapper->find($bootiso->getGroupID())->getTitle()); + $bootiso->setMembershipID("[".$bootiso->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootiso->getMembershipID())->getPersonID())->getFirstname()); + } + + } + + public function createbootisoAction() + { + $groupmapper = new Application_Model_GroupMapper(); + + if (!isset($_POST["createbootiso"])){ + $createbootisoForm = new Application_Form_BootisoCreate(array('grouplist' => $groupmapper->fetchAll())); + } else { + + $createbootisoForm = new Application_Form_BootisoCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); + + if ($createbootisoForm->isValid($_POST)) { + + $bootiso = new Application_Model_BootIso($_POST); + $bootiso->setMembershipID('1'); + $bootisomapper = new Application_Model_BootIsoMapper(); + $bootiso->setCreated(time()); + + try { + $bootisomapper->save($bootiso); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + + } + $this->_redirect('/bootiso'); + } + } + + $this->view->createbootisoForm = $createbootisoForm; + } + + public function editbootisoAction() + { + $bootisoID = $this->_request->getParam('bootisoID'); + $groupmapper = new Application_Model_GroupMapper(); + + if (!isset($_POST["editbootiso"])){ + $bootisoID = $this->_request->getParam('bootisoID'); + if (!isset($bootisoID) || !is_numeric($bootisoID)){ + $this->_redirect('/bootiso'); + } else { + $bootiso = new Application_Model_BootIso(); + $bootisomapper = new Application_Model_BootIsoMapper(); + $bootisomapper->find($bootisoID, $bootiso); + + $editbootisoForm = new Application_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll())); + $editbootisoForm->populate($bootiso->toArray()); + } + }else{ + $editbootisoForm = new Application_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); + + if ($editbootisoForm->isValid($_POST)) { + + $bootiso = new Application_Model_BootIso($_POST); + $bootiso->setMembershipID('1'); + $bootisomapper = new Application_Model_BootIsoMapper(); + $bootiso->setCreated(time()); + $bootiso->setID($bootisoID); + + try { + $bootisomapper->save($bootiso); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + } + + $this->_redirect('/bootiso'); + } + + } + + $this->view->editbootisoForm = $editbootisoForm; + } + + public function deletebootisoAction() + { + $bootisoID = $this->_request->getParam('bootisoID'); + if (!isset($bootisoID)){ + $this->_redirect('/bootiso'); + } else { + $bootiso = new Application_Model_BootIso(); + $bootiso->setID($bootisoID); + $bootisomapper = new Application_Model_BootIsoMapper(); + $bootisomapper->delete($bootiso); + } + $this->_redirect('/bootiso'); + } + + +} + + + + + + + diff --git a/application/modules/dev/controllers/BootmenuController.php b/application/modules/dev/controllers/BootmenuController.php new file mode 100644 index 0000000..641b547 --- /dev/null +++ b/application/modules/dev/controllers/BootmenuController.php @@ -0,0 +1,328 @@ +view->bootosmapper = $bootosmapper; + $this->view->configmapper = $configmapper; + + $bootmenuID = $this->_request->getParam('bootmenuid'); + $preboot = $this->_request->getParam('preboot'); + + if($preboot=="") + { + if($bootmenuID == "") + { + $this->view->bootmenulist = $bootmenumapper->fetchAll(); + $bootmenuentries = array(); + foreach ($this->view->bootmenulist as $bootmenu){ + $bootmenuentries[$bootmenu->getID()] = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenu->getID()); + $bootmenu->setGroupID("[".$bootmenu->getGroupID()."] ".$groupmapper->find($bootmenu->getGroupID())->getTitle()); + $bootmenu->setMembershipID("[".$bootmenu->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootmenu->getMembershipID())->getPersonID())->getFirstname()); + } + }else{ + $bootmenu = new Application_Model_BootMenu(); + $bootmenumapper->find($bootmenuID, $bootmenu); + + $bootmenuentries = array(); + $bootmenuentries[$bootmenuID] = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenuID); + $bootmenu->setGroupID("[".$bootmenu->getGroupID()."] ".$groupmapper->find($bootmenu->getGroupID())->getTitle()); + $bootmenu->setMembershipID("[".$bootmenu->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootmenu->getMembershipID())->getPersonID())->getFirstname()); + + $this->view->bootmenulist = array($bootmenu); + + } + + $this->view->bootmenuentrylist = $bootmenuentries; + + }else{ + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + if($bootmenuID == "") + { + $this->view->bootmenulist = $bootmenumapper->fetchAll(); + $bootmenuentries = array(); + foreach ($this->view->bootmenulist as $bootmenu){ + $bootmenuentries[$bootmenu->getID()] = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenu->getID()); + $bootmenu->setGroupID("[".$bootmenu->getGroupID()."] ".$groupmapper->find($bootmenu->getGroupID())->getTitle()); + $bootmenu->setMembershipID("[".$bootmenu->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootmenu->getMembershipID())->getPersonID())->getFirstname()); + } + }else{ + $bootmenu = new Application_Model_BootMenu(); + $bootmenumapper->find($bootmenuID, $bootmenu); + + $cc['title'] = $bootmenu->getTitle(); + + $bootmenuentries = array(); + $bootmenuentries = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenuID); + + foreach($bootmenuentries as $bootmenuentry){ + $ar = array(); + $ar['title'] = $bootmenuentry->getTitle(); + $ar['id'] = $bootmenuentry->getID(); + $cc['data'][] = $ar; + } + + echo json_encode($cc); + + //print_a($cc); + + } + + } + } + + public function addbootmenuentryAction() + { + $bootmenuID = $this->_request->getParam('bootmenuID'); + $bootosmapper = new Application_Model_BootOsMapper(); + $configmapper = new Application_Model_ConfigMapper(); + + if (!isset($_POST["addbootmenuentry"])){ + $addbootmenuentryForm = new Application_Form_BootmenuEntriesAdd(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll())); + $addbootmenuentryForm->populate(array('order' => $this->_request->getParam('maxorder'))); + unset($_POST['kcl']); + unset($_POST['configID']); + $addbootmenuentryForm->populate($_POST); + } else { + + $addbootmenuentryForm = new Application_Form_BootmenuEntriesAdd(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()),$_POST); + + if ($addbootmenuentryForm->isValid($_POST)) { + + $bootmenuentry = new Application_Model_BootMenuEntries($_POST); + $bootmenuentry->setBootmenuID($bootmenuID); + + $bootmenuentrymapper = new Application_Model_BootMenuEntriesMapper(); + + try { + if($bootmenuentry->getOrder() < $this->_request->getParam('maxorder')){ + $bootmenuentry->setOrder($bootmenuentry->getOrder()); + $bootmenuentrymapper->order($bootmenuentry); + } + $bootmenuentrymapper->save($bootmenuentry); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + + } + $this->_redirect('/bootmenu'); + } + } + + $this->view->addbootmenuentryForm = $addbootmenuentryForm; + + } + + public function createbootmenuAction() + { + $groupmapper = new Application_Model_GroupMapper(); + + if (!isset($_POST["createbootmenu"])){ + $createbootmenuForm = new Application_Form_BootmenuCreate(array('grouplist' => $groupmapper->fetchAll())); + } else { + + $createbootmenuForm = new Application_Form_BootmenuCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); + + if ($createbootmenuForm->isValid($_POST)) { + + $bootmenu = new Application_Model_BootMenu($_POST); + $bootmenu->setMembershipID('1'); + $bootmenu->setCreated(time()); + $bootmenumapper = new Application_Model_BootMenuMapper(); + + try { + $bootmenumapper->save($bootmenu); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + + } + $this->_redirect('/bootmenu'); + } + } + + $this->view->createbootmenuForm = $createbootmenuForm; + } + + public function editbootmenuAction() + { + $bootmenuID = $this->_request->getParam('bootmenuID'); + $groupmapper = new Application_Model_GroupMapper(); + + if (!isset($_POST["editbootmenu"])){ + $bootmenuID = $this->_request->getParam('bootmenuID'); + if (!isset($bootmenuID) || !is_numeric($bootmenuID)){ + $this->_redirect('/bootmenu'); + } else { + $bootmenu = new Application_Model_BootMenu(); + $bootmenumapper = new Application_Model_BootMenuMapper(); + $bootmenumapper->find($bootmenuID, $bootmenu); + + $editbootmenuForm = new Application_Form_BootmenuEdit(array('grouplist' => $groupmapper->fetchAll())); + $editbootmenuForm->populate($bootmenu->toArray()); + } + }else{ + $editbootmenuForm = new Application_Form_BootmenuEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); + + if ($editbootmenuForm->isValid($_POST)) { + + $bootmenu = new Application_Model_BootMenu($_POST); + $bootmenu->setMembershipID('1'); + $bootmenu->setCreated(time()); + $bootmenumapper = new Application_Model_BootMenuMapper(); + + $bootmenu->setID($bootmenuID); + + try { + + $bootmenumapper->save($bootmenu); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + } + + $this->_redirect('/bootmenu'); + } + + } + + $this->view->editbootmenuForm = $editbootmenuForm; + } + + public function editbootmenuentryAction() + { + $bootmenuentryID = $this->_request->getParam('bootmenuentryID'); + $bootmenuID = $this->_request->getParam('bootmenuID'); + $bootosmapper = new Application_Model_BootOsMapper(); + $configmapper = new Application_Model_ConfigMapper(); + $bootmenuentry = new Application_Model_BootMenuEntries(); + $bootmenuentrymapper = new Application_Model_BootMenuEntriesMapper(); + + if (!isset($_POST["editbootmenuentry"])){ + $bootmenuentryID = $this->_request->getParam('bootmenuentryID'); + if (!isset($bootmenuentryID) || !is_numeric($bootmenuentryID)){ + $this->_redirect('/bootmenu'); + } else { + + $bootmenuentrymapper->find($bootmenuentryID, $bootmenuentry); + + $editbootmenuentryForm = new Application_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll())); + if(!isset($_POST['kcl'])){ + $editbootmenuentryForm->populate($bootmenuentry->toArray()); + } + else{ + unset($_POST['kcl']); + unset($_POST['configID']); + $editbootmenuentryForm->populate($_POST); + } + } + }else{ + $editbootmenuentryForm = new Application_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()),$_POST); + + if ($editbootmenuentryForm->isValid($_POST)) { + + $bootmenuentry = new Application_Model_BootMenuEntries($_POST); + + $bootmenuentry->setBootmenuID($bootmenuID); + $bootmenuentry->setID($bootmenuentryID); + + $bootmenuentrymapper = new Application_Model_BootMenuEntriesMapper(); + + try { + if($bootmenuentry->getOrder() < $this->_request->getParam('oldorder')) + $bootmenuentrymapper->orderbefore($bootmenuentry, $this->_request->getParam('oldorder')); + else + $bootmenuentrymapper->orderafter($bootmenuentry, $this->_request->getParam('oldorder')); + + $bootmenuentrymapper->save($bootmenuentry); + + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + } + + $this->_redirect('/bootmenu'); + } + + } + + $this->view->editbootmenuentryForm = $editbootmenuentryForm; + + } + + public function removebootmenuentryAction() + { + $bootmenuentryID = $this->_request->getParam('bootmenuentryID'); + if (!isset($bootmenuentryID) || !is_numeric($bootmenuentryID)){ + $this->_redirect('/bootmenu'); + } else { + $bootmenuentry = new Application_Model_BootMenuEntries(); + $bootmenuentrymapper = new Application_Model_BootMenuEntriesMapper(); + $bootmenuentrymapper->find($bootmenuentryID, $bootmenuentry); + $bootmenuentrymapper->delete($bootmenuentry); + $bootmenuentrymapper->orderremove($bootmenuentry); + } + $this->_redirect('/bootmenu'); + } + + public function deletebootmenuAction() + { + $bootmenuID = $this->_request->getParam('bootmenuID'); + if (!isset($bootmenuID) || !is_numeric($bootmenuID)){ + $this->_redirect('/bootmenu'); + } else { + $bootmenu = new Application_Model_BootMenu(); + $bootmenu->setID($bootmenuID); + $bootmenumapper = new Application_Model_BootMenuMapper(); + $bootmenumapper->delete($bootmenu); + } + $this->_redirect('/bootmenu'); + } + + private function arrayDiff($a, $b){ + foreach($a as $k1 => $i1){ + foreach($b as $k2 => $i2){ + if($i1->getID() == $i2->getBootosID()){ + unset($a[$k1]); + } + } + } + return $a; + } + + +} + + + + + + + + + + + + + diff --git a/application/modules/dev/controllers/BootosController.php b/application/modules/dev/controllers/BootosController.php new file mode 100644 index 0000000..3a7ab90 --- /dev/null +++ b/application/modules/dev/controllers/BootosController.php @@ -0,0 +1,147 @@ +view->bootoslist = $bootosmapper->fetchAll(); + if(count($this->view->bootoslist)>0){ + foreach ($this->view->bootoslist as $bootos){ + $bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupmapper->find($bootos->getGroupID())->getTitle()); + $bootos->setMembershipID("[".$bootos->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootos->getMembershipID())->getPersonID())->getFirstname()); + $bootos->setConfigID("[".$bootos->getConfigID()."] ".$configmapper->find($bootos->getConfigID())->getTitle()); + + } + } + + } + + public function createbootosAction() + { + $groupmapper = new Application_Model_GroupMapper(); + $configmapper = new Application_Model_ConfigMapper(); + + if (!isset($_POST["createbootos"])){ + $createbootosForm = new Application_Form_BootosCreate(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); + } else { + + $createbootosForm = new Application_Form_BootosCreate(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll()),$_POST); + + if ($createbootosForm->isValid($_POST)) { + + $bootos = new Application_Model_BootOs($_POST); + $bootos->setMembershipID('1'); + if($bootos->getConfigID() == '') + $bootos->setConfigID(NULL); + $bootosmapper = new Application_Model_BootOsMapper(); + $bootos->setCreated(time()); + + try { + $bootosID = $bootosmapper->save($bootos); + + $initpath = "../resources/bootos/".$bootosID."/initramfs/"; + $kernelpath = "../resources/bootos/".$bootosID."/kernel/"; + + exec("wget -P ".$kernelpath." ".$bootos->getPath_kernel()); + exec("wget -P ".$initpath." ".$bootos->getPath_init()); + + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + + } + + $this->_redirect('/bootos'); + } + } + + $this->view->createbootosForm = $createbootosForm; + } + + public function editbootosAction() + { + $bootosID = $this->_request->getParam('bootosID'); + $groupmapper = new Application_Model_GroupMapper(); + $configmapper = new Application_Model_ConfigMapper(); + + if (!isset($_POST["editbootos"])){ + $bootosID = $this->_request->getParam('bootosID'); + if (!isset($bootosID) || !is_numeric($bootosID)){ + $this->_redirect('/bootos'); + } else { + $bootos = new Application_Model_BootOs(); + $bootosmapper = new Application_Model_BootOsMapper(); + $bootos = $bootosmapper->find($bootosID); + + $editbootosForm = new Application_Form_BootosEdit(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); + $editbootosForm->populate($bootos->toArray()); + } + }else{ + $editbootosForm = new Application_Form_BootosEdit(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll()),$_POST); + + if ($editbootosForm->isValid($_POST)) { + + $bootos = new Application_Model_BootOs($_POST); + $bootos->setMembershipID('1'); + if($bootos->getConfigID() == '') + $bootos->setConfigID(NULL); + $bootosmapper = new Application_Model_BootOsMapper(); + $bootos->setCreated(time()); + $bootos->setID($bootosID); + + try { + $bootosmapper->save($bootos); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + } + + $this->_redirect('/bootos'); + } + + } + + $this->view->editbootosForm = $editbootosForm; + + } + + public function deletebootosAction() + { + $bootosID = $this->_request->getParam('bootosID'); + if (!isset($bootosID)){ + $this->_redirect('/bootos'); + } else { + $bootos = new Application_Model_BootOs(); + $bootos->setID($bootosID); + $bootosmapper = new Application_Model_BootOsMapper(); + $bootosmapper->delete($bootos); + } + $this->_redirect('/bootos'); + + } + + +} + + + + + + + diff --git a/application/modules/dev/controllers/ClientController.php b/application/modules/dev/controllers/ClientController.php new file mode 100644 index 0000000..affa780 --- /dev/null +++ b/application/modules/dev/controllers/ClientController.php @@ -0,0 +1,90 @@ +view->clients = $clientMapper->fetchAll(); + } + + public function addclientAction() + { + $mac = $this->_request->getParam('mac'); + $hh = $this->_request->getParam('hh'); + + if (!isset($_POST["add"])){ + $addclient = new Application_Form_Client(array('buttontext' => 'Create Client')); + $this->view->addclient = $addclient; + } + else{ + $addfilterform = new Application_Form_Client(array('buttontext' => 'Create Client'),$_POST); + if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) { + $client = new Application_Model_Client(); + $mac = ($mac!='')?$mac:$_POST['macadress']; + $hh = ($hh!='')?$hh:$_POST['hardwarehash']; + $client->setMacadress($mac); + $client->setHardwarehash($hh); + $clientmapper = new Application_Model_ClientMapper(); + $clientmapper->save($client); + print_a('inserted'); + $this->_redirect('/client'); + } + $this->view->addclient = $addclient; + } + } + + public function removeclientAction() + { + $clientID = $this->_request->getParam('clientID'); + // TODO: ACL implementieren ob er den filter löschen darf + if(is_numeric($clientID)){ + $removeClient = new Application_Model_Client(); + $removeClient->setID($clientID); + $clientMapper = new Application_Model_ClientMapper(); + $clientMapper->delete($removeClient); + } + $this->_redirect('/client'); + } + + public function editclientAction() + { + if (!isset($_POST["add"])){ + $clientID = $this->_request->getParam('clientID'); + $data = new Application_Model_Client(); + $mapper = new Application_Model_ClientMapper(); + $mapper->find($clientID,$data); + + $editclient = new Application_Form_Client(array('buttontext' => 'Edit Client')); + $editclient->populate($data->toArray()); + $this->view->editclient = $editclient; + } + else{ + $editclient = new Application_Form_Client(array('buttontext' => 'Edit 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(); + $clientmapper->save($client); + print_a('updated'); + $this->_redirect('/client'); + } + $this->view->editclient = $editclient; + } + } + + +} + + + + + + + diff --git a/application/modules/dev/controllers/ConfigController.php b/application/modules/dev/controllers/ConfigController.php new file mode 100644 index 0000000..3eff0cc --- /dev/null +++ b/application/modules/dev/controllers/ConfigController.php @@ -0,0 +1,126 @@ +view->configlist = $configmapper->fetchAll(); + + foreach ($this->view->configlist as $config){ + $config->setGroupID("[".$config->getGroupID()."] ".$groupmapper->find($config->getGroupID())->getTitle()); + $config->setMembershipID("[".$config->getMembershipID()."] ".$personmapper->find($membershipmapper->find($config->getMembershipID())->getPersonID())->getFirstname()); + } + + } + + public function createconfigAction() + { + $groupmapper = new Application_Model_GroupMapper(); + if (!isset($_POST["createconfig"])){ + $createconfigForm = new Application_Form_ConfigCreate(array('grouplist' => $groupmapper->fetchAll())); + } else { + + $createconfigForm = new Application_Form_ConfigCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); + + if ($createconfigForm->isValid($_POST)) { + + $config = new Application_Model_Config($_POST); + $config->setCreated(time()); + $config->setMembershipID('1'); + + $configmapper = new Application_Model_ConfigMapper(); + + try { + $configmapper->save($config); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + + } + $this->_redirect('/config'); + } + } + + $this->view->createconfigForm = $createconfigForm; + } + + public function editconfigAction() + { + $configID = $this->_request->getParam('configID'); + $groupmapper = new Application_Model_GroupMapper(); + + if (!isset($_POST["editconfig"])){ + $configID = $this->_request->getParam('configID'); + if (!isset($configID) || !is_numeric($configID)){ + $this->_redirect('/config'); + } else { + $config = new Application_Model_Config(); + $configmapper = new Application_Model_ConfigMapper(); + $config = $configmapper->find($configID); + + $editconfigForm = new Application_Form_ConfigEdit(array('grouplist' => $groupmapper->fetchAll())); + $editconfigForm->populate($config->toArray()); + } + }else{ + $editconfigForm = new Application_Form_ConfigEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); + + if ($editconfigForm->isValid($_POST)) { + + $config = new Application_Model_Config($_POST); + $configmapper = new Application_Model_ConfigMapper(); + $config->setCreated(time()); + $config->setMembershipID('1'); + $config->setID($configID); + + try { + $configmapper->save($config); + }catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + } + + $this->_redirect('/config'); + } + + } + + $this->view->editconfigForm = $editconfigForm; + } + + public function deleteconfigAction() + { + $configID = $this->_request->getParam('configID'); + if (!isset($configID)){ + $this->_redirect('/config'); + } else { + $config = new Application_Model_Config(); + $config->setID($configID); + $configmapper = new Application_Model_ConfigMapper(); + $configmapper->delete($config); + } + $this->_redirect('/config'); + } + + +} + + + + + + + diff --git a/application/modules/dev/controllers/ErrorController.php b/application/modules/dev/controllers/ErrorController.php new file mode 100644 index 0000000..5bb2749 --- /dev/null +++ b/application/modules/dev/controllers/ErrorController.php @@ -0,0 +1,51 @@ +_getParam('error_handler'); + + switch ($errors->type) { + case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE: + case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: + case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION: + + // 404 error -- controller or action not found + $this->getResponse()->setHttpResponseCode(404); + $this->view->message = 'Page not found'; + break; + default: + // application error + $this->getResponse()->setHttpResponseCode(500); + $this->view->message = 'Application error'; + break; + } + + // Log exception, if logger available + if ($log = $this->getLog()) { + $log->crit($this->view->message, $errors->exception); + } + + // conditionally display exceptions + if ($this->getInvokeArg('displayExceptions') == true) { + $this->view->exception = $errors->exception; + } + + $this->view->request = $errors->request; + } + + public function getLog() + { + $bootstrap = $this->getInvokeArg('bootstrap'); + if (!$bootstrap->hasPluginResource('Log')) { + return false; + } + $log = $bootstrap->getResource('Log'); + return $log; + } + + +} + diff --git a/application/modules/dev/controllers/FilterController.php b/application/modules/dev/controllers/FilterController.php new file mode 100644 index 0000000..da52c34 --- /dev/null +++ b/application/modules/dev/controllers/FilterController.php @@ -0,0 +1,680 @@ +_filtermapper = new Application_Model_FilterMapper(); + }catch (Zend_Exception $e) { + echo "Error message 1: " . $e->getMessage() . "\n"; + } + $this->db = Zend_Db_Table::getDefaultAdapter(); + } + + public function indexAction() + { + try{ + $this->_filtermapper = new Application_Model_FilterMapper(); + $this->view->filters = $this->_filtermapper->fetchAll(); + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + + public function addfilterAction() + { + $bmmapper = new Application_Model_BootMenuMapper(); + //TODO get bootmenu by group + $bootmenus = $bmmapper->fetchAll(); + if (!isset($_POST["add"])){ + $addfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus)); + $this->view->addfilterform = $addfilterform; + }else { + $addfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus),$_POST); + if ($addfilterform->isValid($_POST)) { + try{ + $newfilter = new Application_Model_Filter($_POST); + $newfilter->setCreated(time()); + + // TODO: Ändere mit ACL + $newfilter->setGroupID('1'); + $newfilter->setMembershipID('1'); + + $newfilter2 = new Application_Model_FilterMapper(); + $newfilter2->save($newfilter); + + $this->_redirect('/filter'); + return; + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + $this->view->addfilterform = $addfilterform; + } + } + + public function removefilterAction() + { + $filterID = $this->_request->getParam('filterID'); + // TODO: ACL implementieren ob er den filter löschen darf + if(is_numeric($filterID)){ + $deletefilter = new Application_Model_Filter(); + $deletefilter->setID($filterID); + $filtermapper = new Application_Model_FilterMapper(); + $filtermapper->delete($deletefilter); + } + $this->_redirect('/filter'); + } + + 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'); + $filter = new Application_Model_Filter(); + + + $filtermapper = new Application_Model_FilterMapper(); + $filtermapper->find($filterID,$filter); + $filter2 = $filter->toArray(); + + $editfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus)); + $editfilterform->populate($filter2); + $this->view->editfilterform = $editfilterform; + + } else{ + try{ + $filterID = $this->_request->getParam('filterID'); + + $editfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus),$_POST); + //TODO: ACL integrieren + $_POST['groupID'] = 1; + $_POST['membershipID'] = 1; + $_POST['created'] = time(); + + if ($editfilterform->isValid($_POST)) { + $newfilterenty = new Application_Model_Filter($_POST); + $newfilterenty->setID($this->_request->getParam('filterID')); + $newfilter2 = new Application_Model_FilterMapper(); + $newfilter2->save($newfilterenty); + echo 'valid'; + $this->_redirect('/filter'); + } + $this->view->editfilterform = $editfilterform; + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + } + + public function addfilterentryAction() + { + // TODO: ACL implementieren ob er editieren darf + if (!isset($_POST["add"])){ + try{ + $editfilterform = new Application_Form_FilterEntriesAdd( + array( 'buttontext' => 'Add Filterentry', + 'filterID' => $this->_request->getParam('filterID'), + 'data' => $_POST + )); + $editfilterform->populate($_POST); + $this->view->editfilterform = $editfilterform; + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } else{ + $editfilterform = new Application_Form_FilterEntriesAdd(array('buttontext' => 'Add Filterentry'),$_POST); + if ($editfilterform->isValid($_POST)) { + $newfilterenty = new Application_Model_FilterEntries(); + $newfilterenty->setFilterID($_POST['filterID']); + $newfilterenty->setFiltertypeID($_POST['filtertypeID']); + + if($_POST['filtertypeID'] == 1){ + $newfilterenty->setFiltervalue($this->fillIP($_POST['filtervalue'])); + $newfilterenty->setFiltervalue2($this->fillIP($_POST['filtervalue2'])); + } + else{ + $newfilterenty->setFiltervalue($_POST['filtervalue']); + $newfilterenty->setFiltervalue2($_POST['filtervalue2']); + } + + $newfilter2 = new Application_Model_FilterEntriesMapper(); + $newfilter2->save($newfilterenty); + #print_a($newfilterenty); + $this->_redirect('/filter'); + } + $this->view->editfilterform = $editfilterform; + } + } + + public function editfilterentryAction() + { + if (!isset($_POST["add"])){ + try{ + $filterentriesID = $this->_request->getParam('filterentriesID'); + + $filterentry = new Application_Model_FilterEntries(); + + $filterentriesmapper = new Application_Model_FilterEntriesMapper(); + $filterentriesmapper->find($filterentriesID,$filterentry); + + + + #$editfilterform->setFilterID($filterID); + if(isset($_POST['filtertypeID']) && $_POST['filtertypeID'] != $filterentry->getFiltertypeID()){ + $filterentry->setFiltertypeID($_POST['filtertypeID']) ; + } + $data = $filterentry->toArray(); + print_a($data); + $editfilterform = new Application_Form_FilterEntriesAdd( + array('buttontext' => 'Edit Filterentry', + 'data' => $data)); + + $editfilterform->populate($filterentry->toArray()); + $this->view->editfilterform = $editfilterform; + + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } else{ + try{ + $filterentriesID = $this->_request->getParam('filterentriesID'); + $editfilterform = new Application_Form_FilterEntriesAdd(array('buttontext' => 'Edit Filterentry'),$_POST); + if ($editfilterform->isValid($_POST)) { + if($_POST['filterID'] == '') + unset($_POST['filterID']); + $newfilterenty = new Application_Model_FilterEntries($_POST); + $newfilterenty->setID($filterentriesID); + if($_POST['filtertypeID'] == 1){ + $newfilterenty->setFiltervalue($this->fillIP($_POST['filtervalue'])); + $newfilterenty->setFiltervalue2($this->fillIP($_POST['filtervalue2'])); + } + else{ + $newfilterenty->setFiltervalue($_POST['filtervalue']); + $newfilterenty->setFiltervalue2($_POST['filtervalue2']); + } + $newfilter2 = new Application_Model_FilterEntriesMapper(); + $newfilter2->save($newfilterenty); + #print_a($newfilterenty); + $this->_redirect('/filter'); + + } + $this->view->editfilterform = $editfilterform; + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + } + + public function removefilterentryAction() + { + try{ + $filterentriesID = $this->_request->getParam('filterentriesID'); + + // TODO: ACL implementieren ob er den filter löschen darf + if(is_numeric($filterentriesID)){ + $deletefilterentry = new Application_Model_FilterEntries(); + $deletefilterentry->setID($filterentriesID); + echo "
";
+    				print_r($deletefilterentry);
+    				echo "
"; + + $filterentriesmapper = new Application_Model_FilterEntriesMapper(); + $filterentriesmapper->delete($deletefilterentry); + echo "ok"; + } + $this->_redirect('/filter'); + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + + private function fillIP($ip) + { + $ar = explode(".",$ip); + $representation = array(); + foreach($ar as $part){ + $representation[] = sprintf("%03s",$part); + } + return implode(".",$representation); + } + + private function fillMac($ip) + { + $ar = explode(":",$ip); + $representation = array(); + foreach($ar as $part){ + $representation[] = sprintf("%02s",$part); + } + return implode(":",$representation); + } + + public function evaluateAction() + { + $db = $this->db; + $showPartResults = false; + // For Testing Filters + + + $testFilter = (isset($_POST['submit']))?true:false; + + if($testFilter){ + $ipAdress = $_POST['ip']; + $macAdress = $_POST['mac']; + $poolID = $_POST['poolID']; + $bootisoID = $_POST['bootisoID']; + $membershipID = $_POST['membershipID']; + $groupID = $_POST['groupID']; + $time = ($_POST['time']); + $clientID = $_POST['clientID']; + $weekday = $_POST['weekday']; + $date = $_POST['date']; + print_a('Input', + array('ipAdress'=>$ipAdress, + 'macAdress'=>$macAdress, + 'poolID' => $poolID, + 'bootisoID' => $bootisoID, + 'membershipID'=>$membershipID, + 'groupID'=>$groupID, + 'time'=> $time." - ".date('d.m.Y H:i:s',$time), + 'clientID' => $clientID, + 'hardwarehash' => $hardwarehash, + 'weekday' => $weekday, + 'date' => $date)); + } + + + try{ + $mysession = '1'; + $set = array(); + + + $session = new Application_Model_Session(); + $sessionmapper = new Application_Model_SessionMapper(); + $sessionmapper->find($mysession,$session); + ######################################################### + // IP Adress + $filtertypID = 1; + // get it from session_table with session_id from the session + if(!$testFilter){ + $ipAdress = $session->getIp(); + } + $ipAdress = str_replace(".","",$this->fillIP($ipAdress)); + + $select = $db->select() + ->from(array('pbs_filterentries') + ) + ->where('filtertypeID = ?',$filtertypID) + ->where('REPLACE(filtervalue,".","") <= ?',$ipAdress) + ->where('? <= REPLACE(filtervalue2,".","")',$ipAdress); + + $stmt = $select->query(); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + + if($showPartResults) + print_a('ipAdress',$result,$set[$filtertypID]); + + ######################################################### + // Mac range + $filtertypID = 2; + // get it from session_table with session_id from the session + if(!$testFilter){ + $client = new Application_Model_Client(); + $clientmapper = new Application_Model_ClientMapper(); + $clientmapper->find($session->getClientID(),$client); + $macAdress = $client->getMacadress(); + } + try{ + $macAdress = $this->fillMac($macAdress); + $stmt = $db->query("SELECT * FROM pbs_filterentries WHERE + filtertypeID = ".$filtertypID." AND + filtervalue <= '".$macAdress."' AND + '".$macAdress."' <= filtervalue2"); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + if($showPartResults) + print_a('macAdress',$result,$set[$filtertypID]); + + ######################################################### + // PoolID + $filtertypID = 3; + // get PoolID from client_ID from session_id from the session + if(!$testFilter){ + $poolentry = new Application_Model_PoolEntries(); + $poolentrymapper = new Application_Model_PoolEntriesMapper(); + $poolentry = $poolentrymapper->findby('clientID',$client->getID()); + $poolentry = $poolentry[0]; + + $poolID = $poolentry['poolID']; + } + + try{ + $stmt = $db->query("SELECT * FROM pbs_filterentries WHERE + filtertypeID = ".$filtertypID." AND + filtervalue = ".$poolID." "); + $result = $stmt->fetchAll(); + if(count($result)>0){ + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('poolID',$result,$set[$filtertypID]); + ######################################################### + // ClientID + $filtertypID = 8; + // get client_ID from session_id from the session + + if(!$testFilter){ + $clientID = $session->getClientID(); + } + try{ + $stmt = $db->query("SELECT * FROM pbs_filterentries WHERE + filtertypeID = ".$filtertypID." AND + filtervalue = ".$clientID." "); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('clientID',$result,$set[$filtertypID]); + ######################################################### + // BootIsoID + $filtertypID = 4; + // get BootIsoID from client_ID from session_id from the session + if(!$testFilter){ + $bootisoID = $session->getBootisoID(); + } + try{ + $stmt = $db->query("SELECT * FROM pbs_filterentries WHERE + filtertypeID = ".$filtertypID." AND + filtervalue = ".$bootisoID." "); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('bootisoID',$result,$set[$filtertypID]); + ######################################################### + // MembershipID + $filtertypID = 5; + + if(!$testFilter){ + // get membership from the session + //TODO: GET MEMBERSHIP from SESSION + $membershipID = 1; + } + try{ + $stmt = $db->query("SELECT * FROM pbs_filterentries WHERE + filtertypeID = ".$filtertypID." AND + filtervalue = ".$membershipID." "); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('membership',$result,$set[$filtertypID]); + ######################################################### + // GroupID + $filtertypID = 6; + + if(!$testFilter){ + // get membership from the session + //TODO: GET GROUP from SESSION + $groupID = 1; + } + try{ + $stmt = $db->query("SELECT * FROM pbs_filterentries WHERE + filtertypeID = ".$filtertypID." AND + filtervalue = ".$groupID." "); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('membership',$result,$set[$filtertypID]); + ######################################################### + // Time + $filtertypID = 7; + if(!$testFilter){ + $time = time("H:i"); + } + + $nowShort = $time; + + $nowShort = str_replace(":","",$nowShort); + try{ + $select = $db->select() + ->from(array('pbs_filterentries') + ) + ->where('filtertypeID = ?',$filtertypID) + ->where('REPLACE(filtervalue,":","") <= ? AND ? <= REPLACE(filtervalue2,":","")',$nowShort); + + $stmt = $select->query(); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('time',$result,$set[$filtertypID]); + ######################################################### + // Hardwarehash + $filtertypID = 9; + if(!$testFilter){ + // get hardwarehash from session + $hardwarehash = 'aaaa'; + } + + try{ + $select = $db->select() + ->from(array('pbs_filterentries') + ) + ->where('filtertypeID = ?',$filtertypID) + ->where('`filtervalue` = ?',$hardwarehash); + $stmt = $select->query(); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('hardwarehash',$result,$set[$filtertypID]); + ######################################################### + // weekday + $filtertypID = 10; + if(!$testFilter){ + $weekday = date('N'); + } + + try{ + $select = $db->select() + ->from(array('pbs_filterentries') + ) + ->where('filtertypeID = ?',$filtertypID) + ->where('filtervalue = ? ',$weekday); + + $stmt = $select->query(); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('weekday',$result,$set[$filtertypID]); + ######################################################### + // weekday + $filtertypID = 11; + if(!$testFilter){ + $date = date('d.m.Y'); + } + + try{ + $select = $db->select() + ->from(array('pbs_filterentries') + ) + ->where('filtertypeID = ?',$filtertypID) + ->where('REPLACE(filtervalue,".","") <= ? AND ? <= REPLACE(filtervalue2,".","")',$date); + + $stmt = $select->query(); + $result = $stmt->fetchAll(); + foreach($result as $r){ + $set[$filtertypID][] = $r['filterID']; + } + } + catch(Exception $e){} + + if($showPartResults) + print_a('weekday',$result,$set[$filtertypID]); + ######################################## + // ErgebnisSet auswerten + print_a('the result sets of the filtertypes',$set); + + // Merging of the resultsets of the filter + $kk = array(); + foreach($set as $myset){ + $kk = array_merge($kk,$myset); + } + $set = $kk; + // counting how often a filter is evaluated at database + $a = array(); + foreach($set as $k=> $s){ + $a[$s] += 1; + } + print_a('Übereinstimmungen pro Filter',$a); + // Get the number of filtertypes every filter has + $stmt = $db->query('SELECT filterID, COUNT(filtertypeID) as num FROM pbs_filterentries GROUP BY filterID'); + $resultset = $stmt->fetchAll(); + foreach($resultset as $d){ + $database[$d['filterID']] = $d['num']; + } + print_a('Anzahl Filterentries in Datenbank',$database); + + // remove all filters from resultset, which to few filtertypes satisfied + $result = array(); + foreach($a as $i=>$b){ + if($a[$i] < $database[$i]){ + unset($a[$i]); + } + else{ + $result[] = $i; + } + } + + print_a('True Filters',$result); + // now selecting the filter with the highest priority + $query = 'SELECT filterID, bootmenuID, priority + FROM pbs_filter WHERE '; + foreach($result as $e){ + $queryTmp[] = "filterID = '$e'"; + } + $query .= implode(" OR ", $queryTmp); + $query .= 'ORDER BY priority DESC LIMIT 0,1'; + $bootmenuID = 'null'; + try{ + $stmt = $db->query($query); + $resultset = $stmt->fetchAll(); + $bootmenuID = $resultset[0]['bootmenuID']; + } + catch(Exception $e){ + } + if($bootmenuID != 'null'){ + $bm = new Application_Model_BootMenu(); + $bmmapper = new Application_Model_BootMenuMapper(); + $bmmapper->find($bootmenuID,$bm); + echo "

Goto BootmenuID: ".$bootmenuID."

"; + } + else{ + echo "

No Result :-(

"; + } + + }catch (Zend_Exception $e) { + echo "class: ".get_class($e)."
\n"; + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + + public function testevaluateAction() + { + $pm = new Application_Model_PoolMapper(); + $pools = $pm->fetchAll(); + + $bim = new Application_Model_BootIsoMapper(); + $bootisos = $bim->fetchAll(); + + $mm = new Application_Model_MembershipMapper(); + $memberships = $mm->fetchAll(); + + $gm = new Application_Model_GroupMapper(); + $groups = $gm->fetchAll(); + + $cm = new Application_Model_ClientMapper(); + $clients = $cm->fetchAll(); + + $filterevaluate = new Application_Form_FilterEvaluate( + array( 'pools' => $pools, + 'bootisos' => $bootisos, + 'memberships' => $memberships, + 'groups' => $groups, + 'clients' => $clients, + + )); + $filterevaluate->populate(array( + 'ip' => '132.230.5.6', + 'mac' => '08:00:20:ae:fd:7e', + 'time'=>date('d.m.Y H:i')) + ); + $this->view->filterevaluate = $filterevaluate; + } + + +} + + + + + + + + + + + diff --git a/application/modules/dev/controllers/GroupController.php b/application/modules/dev/controllers/GroupController.php new file mode 100644 index 0000000..fbc7943 --- /dev/null +++ b/application/modules/dev/controllers/GroupController.php @@ -0,0 +1,242 @@ +hasIdentity()) { + $this->groupMapper = new Application_Model_GroupMapper(); + $this->groupGroupsMapper = new Application_Model_GroupGroupsMapper(); + $this->membershipMapper = new Application_Model_MembershipMapper(); + $this->groupRequestMapper = new Application_Model_GroupRequestMapper(); + $this->personmapper = new Application_Model_PersonMapper(); + $this->rolemapper = new Application_Model_RoleMapper(); + $this->groupList = $this->groupMapper->fetchAll(); + } else { + $this->_helper->redirector('login', 'auth'); + } + } + + public function indexAction() + { + $this->view->groupList = $this->groupList; + } + + public function addAction() + { + if (!isset($_POST["add"])){ + $addForm = new Application_Form_GroupAdd(array('grouplist' => $this->groupList)); + } else { + $addForm = new Application_Form_GroupAdd(array('grouplist' => $this->groupList),$_POST); + + if ($addForm->isValid($_POST)) { + $group = new Application_Model_Group($_POST); + try { + $this->groupMapper->save($group); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + if($_POST['superordinatedGroupID'] != -1) { + $lastID = $this->groupMapper->getDbTable()->getDefaultAdapter()->lastInsertId(); + $groupgroups = new Application_Model_GroupGroups(); + $groupgroups->setParentID($_POST['superordinatedGroupID']); + $groupgroups->setGroupID($lastID); + try { + $this->groupGroupsMapper->save($groupgroups); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + + } + echo "Group successfully added.
"; + } + } + + $this->view->addForm = $addForm; + } + + public function editAction() + { + if(!isset($_POST['groupID'])) { + $addForm = new Application_Form_GroupAdd(array('grouplist' => $this->groupList)); + $this->view->addForm = $addForm; + return; + } + if (!isset($_POST["save"])){ + $group = $this->groupMapper->find($_POST['groupID']); + $_POST['title'] = $group->getTitle(); + $_POST['description'] = $group->getDescription(); + $editForm = new Application_Form_GroupEdit(); + } else { + $editForm = new Application_Form_GroupEdit($_POST); + if ($editForm->isValid($_POST)) { + $group = new Application_Model_Group($_POST); + try { + $this->groupMapper->save($group); + } catch(Zend_Exception $e) + { + echo "Email Address already existing."; + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + echo "Successfully saved.
"; + } + } + + $this->view->editForm = $editForm; + } + + public function showAction() + { + if($_POST['groupID']) { + $groupRequests = $this->groupRequestMapper->findBy('groupID', $_POST['groupID']); + if(isset($groupRequests)) { + foreach($groupRequests as $groupRequest) { + $person = $this->personmapper->find($groupRequest['personID']); + $groupRequestList[] = array( + 'grouprequestID' => $groupRequest['grouprequestID'], + 'person' => $person + ); + } + $this->view->groupRequestList = $groupRequestList; + $this->view->roleList = $this->rolemapper->findBy('groupID', $_POST['groupID']); + } + $members = $this->membershipMapper->findBy('groupID', $_POST['groupID']); + if(isset($members)) { + foreach($members as $member) { + $person = $this->personmapper->find($member['personID']); + $membersList[] = array( + 'membershipID' => $member['membershipID'], + 'person' => $person + ); + } + $this->view->memberslist = $membersList; + } + $groupgroups = $this->groupGroupsMapper->findBy('groupID', $_POST['groupID']); + if(is_object($groupgroups)) { + $parentGroup = $this->groupMapper->find($groupgroups->getParentID()); + $this->view->$parentGroup = $parentGroup; + } + $group = $this->groupMapper->find($_POST['groupID']); + $this->view->group = $group; + } + } + + public function linkAction() + { + if (!isset($_POST["link"])){ + $linkForm = new Application_Form_GroupLink(array('grouplist' => $this->groupList)); + } else { + $linkForm = new Application_Form_GroupLink(array('grouplist' => $this->groupList),$_POST); + + if ($linkForm->isValid($_POST)) { + $groupgroups = new Application_Model_GroupGroups(); + $groupgroups->setParentID($_POST['superordinatedGroupID']); + $groupgroups->setGroupID($_POST['groupID']); + try { + $this->groupGroupsMapper->save($groupgroups); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + echo "Groups successfully linked.
"; + } + } + + $this->view->linkForm = $linkForm; + } + + public function deleteAction() + { + if (isset($_POST["groupID"])){ + $group = $this->groupMapper->find($_POST["groupID"]); + try { + $this->groupMapper->delete($group); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + echo "Group successfully deleted.
"; + } + } + + public function grantpersonAction() + { + if(isset($_POST['grouprequestID']) && isset($_POST['roleID'])) { + $groupRequest = $this->groupRequestMapper->find($_POST['grouprequestID']); + try { + $this->groupRequestMapper->delete($groupRequest); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + $membership = new Application_Model_Membership(); + $membership->setGroupID($groupRequest->getGroupID()); + $membership->setPersonID($groupRequest->getPersonID()); + $membership->setRoleID($_POST['roleID']); + try { + $this->membershipMapper->save($membership); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + echo "Chosen Person has been successfully added to the chosen group.
"; + } + } + + public function revokepersonAction() + { + if(isset($_POST['membershipID'])) { + $membership = $this->membershipMapper->find($_POST['membershipID']); + if(isset($membership)) { + try { + $this->membershipMapper->delete($membership); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + echo "Chosen Person has been successfully removed from the chosen group.
"; + } + + } + } +} + + + + + + + + + + + + + + diff --git a/application/modules/dev/controllers/IndexController.php b/application/modules/dev/controllers/IndexController.php new file mode 100644 index 0000000..df2f91c --- /dev/null +++ b/application/modules/dev/controllers/IndexController.php @@ -0,0 +1,22 @@ +hasIdentity()) { + $this->personmapper = new Application_Model_PersonMapper(); + $result = $this->personmapper->findBy('email', Zend_Auth::getInstance()->getIdentity()); + $this->person = new Application_Model_Person($result[0]); + $this->person->setID($result[0]['personID']); + $this->groupMapper = new Application_Model_GroupMapper(); + $this->groupRequestMapper = new Application_Model_GroupRequestMapper(); + $this->membershipMapper = new Application_Model_MembershipMapper(); + $this->memberships = $this->membershipMapper->findBy("personID",$this->person->getID()); + if(isset($this->memberships)) { + foreach($this->memberships as $membership) { + $group = $this->groupMapper->find($membership['groupID']); + $this->groups[] = array ( + 'id' => $group->getID(), + 'title' => $group->getTitle() + ); + } + } + } else { + $this->_helper->redirector('login', 'auth'); + } + } + + public function indexAction() + { + $this->_helper->redirector('show', 'person'); + } + + public function showAction() + { + $this->view->person = $this->person; + $this->view->groups = $this->groups; + } + + public function editAction() + { + $this->view->person = $this->person; + if (!isset($_POST["save"])){ + $editForm = new Application_Form_PersonEdit(); + } else { + $editForm = new Application_Form_PersonEdit($_POST); + if ($editForm->isValid($_POST)) { + if(isset($_POST['newpassword'])) { + $date = new DateTime(); + $this->person->setPassword($_POST['newpassword']); + $this->person->setPasswordSalt(MD5($date->getTimestamp())); + $this->person->setPassword(MD5($this->person->getPassword() . $this->person->getPasswordSalt())); + } + $this->person->setOptions($_POST); + try { + $this->personmapper->save($this->person); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + echo "Email Address already existing."; + return; + } + echo "Successfully saved.
"; + } + } + + $this->view->editForm = $editForm; + } + + public function requestAction() + { + $this->view->person = $this->person; + $allgroups = $this->groupMapper->fetchAll(); + $groupRequests = $this->groupRequestMapper->findBy('personID', $this->person->getID()); + $count = 0; + foreach($allgroups as $group) { + foreach($groupRequests as $groupRequest) { + if($groupRequest['groupID'] == $group->getID()) { + unset($allgroups[$count]); + } + } + $count++; + } + if (!isset($_POST["request"])){ + if(count($allgroups) <= 0) { + echo "No Groups to choose."; + } + $requestForm = new Application_Form_GroupRequest(array('grouplist' => $allgroups)); + } else { + $requestForm = new Application_Form_GroupRequest(array('grouplist' => $allgroups), $_POST); + if ($requestForm->isValid($_POST)) { + $groupRequestMapper = new Application_Model_GroupRequestMapper(); + $groupRequest = new Application_Model_GroupRequest(); + $groupRequest->setGroupID($_POST['groupID']); + $date = new DateTime(); + $groupRequest->setTime($date->getTimestamp()); + $groupRequest->setPersonID($this->person->getID()); + try { + $groupRequestMapper->save($groupRequest); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + echo "Successfully requested.
"; + } + } + $this->view->requestForm = $requestForm; + } + + public function leaveAction() + { + $this->view->person = $this->person; + if(isset($_POST['groupID'])) { + if(isset($this->memberships)) { + foreach($this->memberships as $membership) { + if($membership['groupID'] == $_POST['groupID']) { + $membershipObject = $this->membershipMapper->find($membership['membershipID']); + try { + $this->membershipMapper->delete($membershipObject); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + echo "You have been successfully removed from the chosen group.
"; + } + } + } + } + } +} + + + + + + + + + + + diff --git a/application/modules/dev/controllers/PoolController.php b/application/modules/dev/controllers/PoolController.php new file mode 100644 index 0000000..f27ee45 --- /dev/null +++ b/application/modules/dev/controllers/PoolController.php @@ -0,0 +1,176 @@ +view->pools = $poolMapper->fetchAll(); + + $clientmapper = new Application_Model_ClientMapper(); + $clients = $clientmapper->fetchAll(); + foreach($clients as $c){ + #$client = new Application_Model_Client($c); + $clientsArray[] = $c->toArray(); + } + $assignedclientmapper = new Application_Model_PoolEntriesMapper(); + $assignedclients = $assignedclientmapper->fetchAll(); + foreach($assignedclients as $c){ + $assignedclientsArray[] = $c->toArray(); + } + $freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray); + + $this->view->freeclients = $freeclients; + + } + + public function createpoolAction() + { + if (!isset($_POST["add"])){ + $addfilterform = new Application_Form_Pool(array('buttontext' => 'Create Pool')); + $this->view->addpool = $addfilterform; + }else { + $addpoolform = new Application_Form_Pool(array('buttontext' => 'Create Pool'),$_POST); + if ($addpoolform->isValid($_POST)) { + try{ + $pool = new Application_Model_Pool($_POST); + $poolmapper = new Application_Model_PoolMapper(); + $poolmapper->save($pool); + $this->_redirect('/pool'); + return; + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + $this->view->addpool = $addfilterform; + } + } + + public function deletepoolAction() + { + $poolID = $this->_request->getParam('poolID'); + // TODO: ACL implementieren ob er den pool löschen darf + if(is_numeric($poolID)){ + $deletepool = new Application_Model_Pool(); + $deletepool->setID($poolID); + $poolmapper = new Application_Model_PoolMapper(); + $poolmapper->delete($deletepool); + } + $this->_redirect('/pool'); + } + + public function editpoolAction() + { + if (!isset($_POST["add"])){ + $poolID = $this->_request->getParam('poolID'); + + $pool = new Application_Model_Pool(); + $poolmapper = new Application_Model_PoolMapper(); + $poolmapper->find($poolID,$pool); + $poolArray = $pool->toArray(); + + $editpool = new Application_Form_Pool(array('buttontext' => 'Edit Pool')); + $editpool->populate($poolArray); + $this->view->editpoolform = $editpool; + + }else { + $editpoolform = new Application_Form_Pool(array('buttontext' => 'Edit Pool'),$_POST); + if ($editpoolform->isValid($_POST)) { + try{ + $pool = new Application_Model_Pool($_POST); + $pool->setID($this->_request->getParam('poolID')); + $poolmapper = new Application_Model_PoolMapper(); + $poolmapper->save($pool); + $this->_redirect('/pool'); + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + $this->view->editpoolform = $editpoolform; + } + } + + public function linkclientAction() + { + $clientID = $this->_request->getParam('clientID'); + $poolID = $this->_request->getParam('poolID'); + if(!isset($_POST['clientID']) && ($clientID == '')){ + $clientmapper = new Application_Model_ClientMapper(); + $clients = $clientmapper->fetchAll(); + foreach($clients as $c){ + $clientsArray[] = $c->toArray(); + } + $assignedclientmapper = new Application_Model_PoolEntriesMapper(); + $assignedclients = $assignedclientmapper->fetchAll(); + foreach($assignedclients as $c){ + $assignedclientsArray[] = $c->toArray(); + } + $freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray); + + $poolclient = new Application_Form_PoolClient(array('buttontext' => 'Link Client','clients'=> $freeclients)); + $this->view->poolclient = $poolclient; + }else { + $poolclient = new Application_Form_PoolClient(array('buttontext' => 'Link Client'),$_POST); + try{ + $pool = new Application_Model_PoolEntries($_POST); + $pool->setPoolID($this->_request->getParam('poolID')); + if($pool->getClientID() == ''){ + $pool->setClientID($this->_request->getParam('clientID')); + } + $poolmapper = new Application_Model_PoolEntriesMapper(); + $poolmapper->save($pool); + $this->_redirect('/pool'); + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + $this->view->poolclient = $poolclient; + + } + } + private function arrayDiff($a, $b){ + foreach($a as $k1 => $i1){ + foreach($b as $k2 => $i2){ + if($i1['clientID'] == $i2['clientID']){ + unset($a[$k1]); + } + } + } + return $a; + } + + + public function unlinkclientAction() + { + $poolentriesID = $this->_request->getParam('poolentriesID'); + + // TODO: ACL implementieren ob er den filter löschen darf + if(is_numeric($poolentriesID)){ + $deletepoolentries = new Application_Model_PoolEntries(); + $deletepoolentries->setID($poolentriesID); + + $deletepoolentriesmapper = new Application_Model_PoolEntriesMapper(); + $deletepoolentriesmapper->delete($deletepoolentries); + echo "ok"; + } + $this->_redirect('/pool'); + } + + +} + + + + + + + + + + + diff --git a/application/modules/dev/controllers/ResourceController.php b/application/modules/dev/controllers/ResourceController.php new file mode 100644 index 0000000..aef8649 --- /dev/null +++ b/application/modules/dev/controllers/ResourceController.php @@ -0,0 +1,192 @@ +_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $alphasessionID = $this->_request->getParam('alpha'); + $session = new Application_Model_Session(); + $sm = new Application_Model_SessionMapper(); + $result = $sm->findBy('alphasessionID',$alphasessionID); + # print_a($result); + $thisSession = $result[0]; + $bootosID = $thisSession['bootosID']; + + if(is_dir("../resources/bootos/$bootosID/initramfs/") && is_numeric($bootosID)){ + + header('Content-Type: application/x-gzip'); + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + header('Content-Disposition: ' . $content_disp . '; filename="initramfs.tar.gz"'); + header('Pragma: no-cache'); + header('Expires: 0'); + + // create the gzipped tarfile. + chdir("../resources/bootos/$bootosID/initramfs/"); + passthru( "tar cz ./"); + } + } + + public function getconfigAction() + { + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $alphasessionID = $this->_request->getParam('alpha'); + $session = new Application_Model_Session(); + $sm = new Application_Model_SessionMapper(); + $result = $sm->findBy('alphasessionID',$alphasessionID); + # print_a($result); + $thisSession = $result[0]; + $bootmenuentryID = $thisSession['bootmenuentryID']; + $bootmenuentry = new Application_Model_BootMenuEntries(); + $bmm = new Application_Model_BootMenuEntriesMapper(); + $bmm->find($bootmenuentryID,$bootmenuentry); + # print_a($bootmenuentry); + $configID = $bootmenuentry->getConfigID(); + + if(is_dir("../resources/config/$configID/config/") && is_numeric($configID)){ + + header('Content-Type: application/x-gzip'); + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + header('Content-Disposition: ' . $content_disp . '; filename="config.tar.gz"'); + header('Pragma: no-cache'); + header('Expires: 0'); + + // create the gzipped tarfile. + chdir("../resources/config/$configID/config/"); + passthru( "tar cz ./"); + } + } + + public function getkernelAction() + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $alphasessionID = $this->_request->getParam('alpha'); + $session = new Application_Model_Session(); + $sm = new Application_Model_SessionMapper(); + $result = $sm->findBy('alphasessionID',$alphasessionID); + # print_a($result); + $thisSession = $result[0]; + $bootosID = $thisSession['bootosID']; + + + if(is_dir("../resources/bootos/$bootosID/kernel/") && is_numeric($bootosID)){ + + header('Content-Type: application/x-gzip'); + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + header('Content-Disposition: ' . $content_disp . '; filename="kernel.tar.gz"'); + header('Pragma: no-cache'); + header('Expires: 0'); + + // create the gzipped tarfile. + chdir("../resources/bootos/$bootosID/kernel/"); + passthru( "tar cz ./"); + } + } + + public function getkclAction() + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $alphasessionID = $this->_request->getParam('alpha'); + $session = new Application_Model_Session(); + $sm = new Application_Model_SessionMapper(); + $result = $sm->findBy('alphasessionID',$alphasessionID); + # print_a($result); + $thisSession = $result[0]; + $bmeID = $thisSession['bootmenuentryID']; + + if(is_numeric($bmeID)){ + $bmemapper = new Application_Model_BootMenuEntriesMapper(); + $bme = new Application_Model_BootMenuEntries(); + $bmemapper->find($bmeID,$bme); + + if($bme->getKcl() != null){ + header('Content-Type: text/html'); + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + header('Content-Disposition: ' . $content_disp . '; filename="kcl.txt"'); + header('Pragma: no-cache'); + header('Expires: 0'); + echo $bme->getKcl(); + } + + } + + } + + public function getbootmenuentryAction() + { + // obsolete function (now only for debugging) + // after selecting the BootOS it will be saved in session + // so getkclAction, getkernelAction, getconfigAction and getinitramfsAction + // can be called with session-identifier + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $bmeID = $this->_request->getParam('bootmenuentryID'); + $bmeID = 4; + + if(isset($_SESSION['alphasessionID'])){ + $sessionmapper = new Application_Model_SessionMapper(); + $session = $sessionmapper->findBy('alphasessionID',$_SESSION['alphasessionID']); + $session = $session[0]; + if($session['bootmenuentryID'] != null){ + $return_val = + array( + 'info' => 'This function is for debugging purpose only', + 'kernel' => $this->generateURL('getkernel', 'alpha', $_SESSION['alphasessionID']), + 'initramfs' => $this->generateURL('getinitramfs', 'alpha', $_SESSION['alphasessionID']), + 'kcl' => $this->generateURL('getkcl', 'alpha', $_SESSION['alphasessionID']), + 'config' => $_SESSION['alphasessionID'] + ); + echo json_encode($return_val); + } + else{ + echo json_encode( + array( 'info' => 'This function is for debugging purpose only', + 'error'=>'your session is out of date') + ); + } + } + + } + + function generateURL($action, $varname, $varvalue){ + $path = '/resource/'. $action .'/' . $varname .'/' . $varvalue; + $path = "http://" . $_SERVER['SERVER_NAME'] . $path; + return $path; + } + +} + + + + + + + + + + + diff --git a/application/modules/dev/controllers/RoleController.php b/application/modules/dev/controllers/RoleController.php new file mode 100644 index 0000000..7a6c304 --- /dev/null +++ b/application/modules/dev/controllers/RoleController.php @@ -0,0 +1,64 @@ +hasIdentity()) { + + } else { + $this->_helper->redirector('login', 'auth'); + } + } + + public function indexAction() + { + + } + + public function addAction() + { + + } + + public function editAction() + { + + } + + public function showAction() + { + + } + + public function deleteAction() + { + + } + + public function linkrightAction() + { + // action body + } + + public function unlinkrightAction() + { + // action body + } + + +} + + + + + + + + + + + + + diff --git a/application/modules/dev/controllers/SessionController.php b/application/modules/dev/controllers/SessionController.php new file mode 100644 index 0000000..ddb6fac --- /dev/null +++ b/application/modules/dev/controllers/SessionController.php @@ -0,0 +1,182 @@ +view->sessions = $mapper->fetchAll(); + #print_a($_SESSION); + } + private function getUniqueCode($length = "") + { + $code = md5(uniqid(rand(), true)); + if ($length != "") return substr($code, 0, $length); + else return $code; + } + + public function createsessionAction() + { + $cm = new Application_Model_ClientMapper(); + $clients = $cm->fetchAll(); + + $bm = new Application_Model_BootOsMapper(); + $bootos = $bm->fetchAll(); + + $bi = new Application_Model_BootIsoMapper(); + $bootisos = $bi->fetchAll(); + + $bmem = new Application_Model_BootMenuEntriesMapper(); + $bootmenuentries = $bmem->fetchAll(); + + $mm = new Application_Model_MembershipMapper(); + $memberships = $mm->fetchAll(); + + + if (!isset($_POST["add"])){ + $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships)); + $this->view->createsession = $createsession; + }else { + // TODO extend with normal function not only with post + $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); + #print_a($_POST); + if ($createsession->isValid($_POST)) { + try{ + $uniqid = $this->getUniqueCode(10); + $sm = new Application_Model_SessionMapper(); + while(count($sm->findBy('alphasessionID',$uniqid))>0){ + $uniqid = $this->getUniqueCode(16); + } + + $session = new Application_Model_Session($_POST); + $session->setTime(strtotime($_POST['time'])); + $session->setAlphasessionID($uniqid); + + // UNIQUE ID IN SESSION SPEICHERN: + $_SESSION['alphasessionID'] = $uniqid; + + if($session->getClientID() == ''){ + $session->setClientID(null); + } + if($session->getBootosID() == ''){ + $session->setBootosID(null); + } + if($session->getBootmenuentryID() == ''){ + $session->setBootmenuentryID(null); + } + if($session->getMembershipID() == ''){ + $session->setMembershipID(null); + } + $sessionmapper = new Application_Model_SessionMapper(); + $sessionmapper->save($session); + + $this->_redirect('/session'); + + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + $this->view->createsession = $createsession; + } + } + + public function editsessionAction() + { + $cm = new Application_Model_ClientMapper(); + $clients = $cm->fetchAll(); + + $bm = new Application_Model_BootOsMapper(); + $bootos = $bm->fetchAll(); + + $bi = new Application_Model_BootIsoMapper(); + $bootisos = $bi->fetchAll(); + + $bmem = new Application_Model_BootMenuEntriesMapper(); + $bootmenuentries = $bmem->fetchAll(); + + $mm = new Application_Model_MembershipMapper(); + $memberships = $mm->fetchAll(); + + if (!isset($_POST["add"])){ + // TODO: ACL implementieren ob er editieren darf + $sessionID = $this->_request->getParam('sessionID'); + $session = new Application_Model_Session(); + try{ + + $sessionmapper = new Application_Model_SessionMapper(); + $sessionmapper->find($sessionID,$session); + $session->setTime(date('d.m.Y H:i',$session->getTime())); + $session2 = $session->toArray(); + #print_a($session2); + + $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships)); + $editsession->populate($session2); + $this->view->editsession = $editsession; + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + + } else{ + try{ + $sessionID = $this->_request->getParam('sessionID'); + + $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships),$_POST); + + if ($editsession->isValid($_POST)) { + $session = new Application_Model_Session($_POST); + $session->setID($this->_request->getParam('sessionID')); + $session->setTime(strtotime($_POST['time'])); + if($session->getClientID() == ''){ + $session->setClientID(null); + } + if($session->getBootosID() == ''){ + $session->setBootosID(null); + } + if($session->getBootmenuentryID() == ''){ + $session->setBootmenuentryID(null); + } + if($session->getMembershipID() == ''){ + $session->setMembershipID(null); + } + $sessionmapper = new Application_Model_SessionMapper(); + $sessionmapper->save($session); + echo 'valid'; + } + else + { + echo 'not valid'; + } + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + $this->_redirect('/session'); + } + } + + public function deletesessionAction() + { + $sessionID = $this->_request->getParam('sessionID'); + if(is_numeric($sessionID)){ + $deletesession = new Application_Model_Session(); + $deletesession->setID($sessionID); + $sessionmapper = new Application_Model_SessionMapper(); + $sessionmapper->delete($deletesession); + } + $this->_redirect('/session'); + } + + +} + + + + + + + diff --git a/application/modules/dev/forms/AuthDelete.php b/application/modules/dev/forms/AuthDelete.php new file mode 100644 index 0000000..4e9c92d --- /dev/null +++ b/application/modules/dev/forms/AuthDelete.php @@ -0,0 +1,28 @@ +setName("Delete"); + $this->setMethod('post'); + + $this->addElement('text', 'ID', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'ID:', + )); + $this->addElement('submit', 'delete', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Delete', + )); + } + + +} + diff --git a/application/modules/dev/forms/AuthLogin.php b/application/modules/dev/forms/AuthLogin.php new file mode 100644 index 0000000..adffa29 --- /dev/null +++ b/application/modules/dev/forms/AuthLogin.php @@ -0,0 +1,38 @@ +setName("Login"); + $this->setMethod('post'); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'E-Mail:', + )); + + $this->addElement('password', 'password', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Password:', + )); + + $this->addElement('submit', 'login', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Login', + )); + } + + +} + diff --git a/application/modules/dev/forms/AuthRecoverPassword.php b/application/modules/dev/forms/AuthRecoverPassword.php new file mode 100644 index 0000000..fc9478b --- /dev/null +++ b/application/modules/dev/forms/AuthRecoverPassword.php @@ -0,0 +1,28 @@ +setName("RecoverPassword"); + $this->setMethod('post'); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 30)), + ), + 'required' => true, + 'label' => 'Email:', + )); + $this->addElement('submit', 'recoverPassword', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Recover Password', + )); + } + + +} + diff --git a/application/modules/dev/forms/AuthRegister.php b/application/modules/dev/forms/AuthRegister.php new file mode 100644 index 0000000..ae6e766 --- /dev/null +++ b/application/modules/dev/forms/AuthRegister.php @@ -0,0 +1,105 @@ +setName("Register"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + + $this->addElement('text', 'name', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Name:', + )); + + $this->addElement('text', 'firstname', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Firstname:', + )); + + $this->addElement('text', 'street', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Street:', + )); + + $this->addElement('text', 'housenumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Housenumber:', + )); + + $this->addElement('text', 'city', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'City:', + )); + + $this->addElement('text', 'postalcode', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Postalcode:', + )); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Email:', + )); + + $this->addElement('password', 'password', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Password:', + )); + + $this->addElement('submit', 'register', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Register', + )); + + + } + + + +} + diff --git a/application/modules/dev/forms/BootisoCreate.php b/application/modules/dev/forms/BootisoCreate.php new file mode 100644 index 0000000..6efb0c2 --- /dev/null +++ b/application/modules/dev/forms/BootisoCreate.php @@ -0,0 +1,94 @@ +grouplist = $grouplist; + + } + + public function init() + { + $this->setName("BootIsoCreate"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('text', 'path', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Path:', + )); + + $this->addElement('text', 'serialnumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Serialnumber:', + )); + + $date = new DateTime(); + $date->add(new DateInterval('P1Y')); + $this->addElement('text', 'expires', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'value' => $date->format('Y-m-d'), + )); + + $this->addElement('text', 'public', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Public-Level:', + 'value' => '0' + )); + + $this->addElement('submit', 'createbootiso', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Create BootISO', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootiso"' + )); + + } + + +} + diff --git a/application/modules/dev/forms/BootisoEdit.php b/application/modules/dev/forms/BootisoEdit.php new file mode 100644 index 0000000..17c87d6 --- /dev/null +++ b/application/modules/dev/forms/BootisoEdit.php @@ -0,0 +1,92 @@ +grouplist = $grouplist; + + } + + public function init() + { + $this->setName("BootIsoEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('text', 'path', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Path:', + )); + + $this->addElement('text', 'serialnumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Serialnumber:', + )); + + $date = new DateTime(); + $date->add(new DateInterval('P1Y')); + $this->addElement('text', 'expires', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'value' => $date->format('Y-m-d'), + )); + + $this->addElement('text', 'public', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Public-Level:', + )); + + $this->addElement('submit', 'editbootiso', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit BootISO', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootiso"' + )); + + } +} + diff --git a/application/modules/dev/forms/BootmenuCreate.php b/application/modules/dev/forms/BootmenuCreate.php new file mode 100644 index 0000000..a6b4272 --- /dev/null +++ b/application/modules/dev/forms/BootmenuCreate.php @@ -0,0 +1,51 @@ +grouplist = $grouplist; + + } + + public function init() + { + $this->setName("BootMenuCreate"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('submit', 'createbootmenu', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Create Bootmenu', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootmenu"' + )); + + } + + +} + diff --git a/application/modules/dev/forms/BootmenuEdit.php b/application/modules/dev/forms/BootmenuEdit.php new file mode 100644 index 0000000..0b33643 --- /dev/null +++ b/application/modules/dev/forms/BootmenuEdit.php @@ -0,0 +1,51 @@ +grouplist = $grouplist; + + } + + public function init() + { + $this->setName("BootMenuEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('submit', 'editbootmenu', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit BootMenu', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootmenu"' + )); + + } + +} + diff --git a/application/modules/dev/forms/BootmenuEntriesAdd.php b/application/modules/dev/forms/BootmenuEntriesAdd.php new file mode 100644 index 0000000..6981619 --- /dev/null +++ b/application/modules/dev/forms/BootmenuEntriesAdd.php @@ -0,0 +1,110 @@ +bootoslist = $bootoslist; + } + + public function setMaxorder($maxorder){ + $this->maxorder = $maxorder; + + } + + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } + + + public function init() + { + + if(!isset($_POST['bootosID'])){ + $firstbootos = array_slice($this->bootoslist,0,1); + $_POST['bootosID'] = $firstbootos[0]->getID(); + } + + $this->setName("BootMenuEntryAdd"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $bootosfield = $this->createElement('select','bootosID'); + $bootosfield ->setLabel('BootOs:'); + $bootosfield->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();"); + + if(count($this->bootoslist)>0){ + foreach($this->bootoslist as $bootos => $b){ + $bootosfield->addMultiOption($b->getID(), $b->getTitle()); + } + } + $bootosfield->setRegisterInArrayValidator(false); + + $this->addElement($bootosfield); + + $this->addElement('textarea', 'kcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'cols' => 50, + 'rows' => 5, + 'label' => 'KCL:', + 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl() + + )); + + $defaultconfigid = $this->bootoslist[$_POST['bootosID']]->getConfigID(); + $configfield = $this->createElement('select','configID'); + $configfield->setLabel('Config:'); + $configfield->addMultiOption($defaultconfigid, 'default'); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + if($c->getID() != $defaultconfigid) + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); + + $orderfield = $this->createElement('select','order'); + $orderfield ->setLabel('Position:'); + + for ($i = 0; $i <= $this->maxorder; $i++) { + $orderfield->addMultiOption($i, $i+1); + } + $orderfield->setRegisterInArrayValidator(false); + $this->addElement($orderfield); + + $this->addElement('submit', 'addbootmenuentry', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Add Bootmenuentry', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootmenu"' + )); + + } + + + + +} + diff --git a/application/modules/dev/forms/BootmenuEntriesEdit.php b/application/modules/dev/forms/BootmenuEntriesEdit.php new file mode 100644 index 0000000..6dc1aab --- /dev/null +++ b/application/modules/dev/forms/BootmenuEntriesEdit.php @@ -0,0 +1,108 @@ +bootoslist = $bootoslist; + + } + + public function setMaxorder($maxorder){ + $this->maxorder = $maxorder; + + } + + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } + + public function init() + { + + if(!isset($_POST['bootosID'])){ + $firstbootos = array_slice($this->bootoslist,0,1); + $_POST['bootosID'] = $firstbootos[0]->getID(); + } + + $this->setName("BootMenuEntryAdd"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $bootosfield = $this->createElement('select','bootosID'); + $bootosfield->setLabel('BootOs:'); + $bootosfield->setAttrib('onChange', "document.getElementById('BootMenuEntryAdd').submit();"); + + + if(count($this->bootoslist)>0){ + foreach($this->bootoslist as $bootos => $b){ + $bootosfield->addMultiOption($b->getID(), $b->getTitle()); + } + } + $bootosfield->setRegisterInArrayValidator(false); + $this->addElement($bootosfield); + + $this->addElement('textarea', 'kcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'cols' => 50, + 'rows' => 5, + 'label' => 'KCL:', + 'value' => $this->bootoslist[$_POST['bootosID']]->getDefaultkcl() + )); + + $defaultconfigid = $this->bootoslist[$_POST['bootosID']]->getConfigID(); + $configfield = $this->createElement('select','configID'); + $configfield->setLabel('Config:'); + $configfield->addMultiOption($defaultconfigid, 'default'); + + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + if($c->getID() != $defaultconfigid) + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); + + $orderfield = $this->createElement('select','order'); + $orderfield ->setLabel('Position:'); + + for ($i = 0; $i < $this->maxorder; $i++) { + $orderfield->addMultiOption($i, $i+1); + } + $orderfield->setRegisterInArrayValidator(false); + $this->addElement($orderfield); + + $this->addElement('submit', 'editbootmenuentry', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit Bootmenuentry', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootmenu"' + )); + + } + + +} + diff --git a/application/modules/dev/forms/BootosCreate.php b/application/modules/dev/forms/BootosCreate.php new file mode 100644 index 0000000..0377197 --- /dev/null +++ b/application/modules/dev/forms/BootosCreate.php @@ -0,0 +1,135 @@ +grouplist = $grouplist; + + } + + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } + + public function init() + { + $this->setName("BootOsCreate"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + + $configfield = $this->createElement('select','configID'); + $configfield ->setLabel('Config:'); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('text', 'path_init', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 250)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Init-Path:', + )); + + $this->addElement('text', 'path_kernel', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 250)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Kernel-Path:', + )); + + $this->addElement('textarea', 'defaultkcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Default-KCL:', + )); + + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Description:', + )); + + $date = new DateTime(); + $date->add(new DateInterval('P1Y')); + $this->addElement('text', 'expires', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'value' => $date->format('Y-m-d'), + )); + + + $this->addElement('text', 'public', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Public-Level:', + 'value' => '0', + )); + + $this->addElement('submit', 'createbootos', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Create BootOS', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootos"' + )); + + } + + +} + diff --git a/application/modules/dev/forms/BootosEdit.php b/application/modules/dev/forms/BootosEdit.php new file mode 100644 index 0000000..641429d --- /dev/null +++ b/application/modules/dev/forms/BootosEdit.php @@ -0,0 +1,145 @@ +grouplist = $grouplist; + + } + + public function setConfiglist($configlist){ + $this->configlist = $configlist; + + } + + public function init() + { + $this->setName("BootOsEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $configfield = $this->createElement('select','configID'); + $configfield ->setLabel('Config:'); + + if(count($this->configlist)>0){ + foreach($this->configlist as $config => $c){ + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + } + $configfield->setRegisterInArrayValidator(false); + $this->addElement($configfield); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('text', 'path_init', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Init-Path:', + )); + + $this->addElement('text', 'path_kernel', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Kernel-Path:', + )); + + $this->addElement('textarea', 'defaultkcl', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Default-KCL:', + )); + + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'rows' => 5, + 'cols' => 50, + 'label' => 'Description:', + )); + + $date = new DateTime(); + $date->add(new DateInterval('P1Y')); + $this->addElement('text', 'expires', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Expires:', + 'value' => $date->format('Y-m-d'), + )); + + + $this->addElement('text', 'public', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Public-Level:', + 'value' => '0', + )); + + $this->addElement('submit', 'editbootos', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit BootOS', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/bootos"' + )); + + } + + +} + + + diff --git a/application/modules/dev/forms/Client.php b/application/modules/dev/forms/Client.php new file mode 100644 index 0000000..83df97e --- /dev/null +++ b/application/modules/dev/forms/Client.php @@ -0,0 +1,45 @@ +setName("pool"); + $this->setMethod('post'); + + $this->addElement('text', 'macadress', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'MacAdress:', + )); + $this->addElement('text', 'hardwarehash', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Hardwarehash:', + )); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/client"' + )); + } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + + +} + diff --git a/application/modules/dev/forms/ConfigCreate.php b/application/modules/dev/forms/ConfigCreate.php new file mode 100644 index 0000000..3aa142c --- /dev/null +++ b/application/modules/dev/forms/ConfigCreate.php @@ -0,0 +1,63 @@ +grouplist = $grouplist; + + } + + public function init() + { + $this->setName("ConfigCreate"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('textarea', 'shellscript', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'rows' => 10, + 'cols' => 70, + 'label' => 'Shellscript:', + )); + + $this->addElement('submit', 'createconfig', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Create Config', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/config"' + )); + + } + +} + diff --git a/application/modules/dev/forms/ConfigEdit.php b/application/modules/dev/forms/ConfigEdit.php new file mode 100644 index 0000000..53219d9 --- /dev/null +++ b/application/modules/dev/forms/ConfigEdit.php @@ -0,0 +1,62 @@ +grouplist = $grouplist; + + } + + public function init() + { + $this->setName("ConfigEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('textarea', 'shellscript', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'rows' => 10, + 'cols' => 70, + 'label' => 'Shellscript:', + )); + + $this->addElement('submit', 'editconfig', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Edit Config', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/config"' + )); + + } + +} + diff --git a/application/modules/dev/forms/FilterAdd.php b/application/modules/dev/forms/FilterAdd.php new file mode 100644 index 0000000..b720089 --- /dev/null +++ b/application/modules/dev/forms/FilterAdd.php @@ -0,0 +1,65 @@ +setName("Add Filter"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'required' => false, + 'label' => 'Description:', + )); + + $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'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Priority:', + )); + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/filter"' + )); + } + function setBootmenus($val){ + $this->bootmenus = $val; + return; + } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + +} + diff --git a/application/modules/dev/forms/FilterEntriesAdd.php b/application/modules/dev/forms/FilterEntriesAdd.php new file mode 100644 index 0000000..9f9c642 --- /dev/null +++ b/application/modules/dev/forms/FilterEntriesAdd.php @@ -0,0 +1,145 @@ +setName("Add Filterentry"); + $this->setMethod('post'); + $this->setAttrib('id','filterentryform'); + #print_a($this->data); + + try{ + $filtertypemapper = new Application_Model_FilterTypeMapper(); + $filtertype = $filtertypemapper->fetchAll(); + + $filtertypes = $this->createElement('select','filtertypeID'); + $filtertypes ->setLabel('Type:'); + $filtertypes ->setAttrib('id','filtertype'); + $filtertypes->addMultiOption('',''); + foreach($filtertype as $f){ + $filtertypes->addMultiOption($f->getID(),$f->getFiltertypename()); + } + $filterentry = $filtertypes->getMultiOption($this->data['filtertypeID']); + $filterentryID = $this->data['filtertypeID']; + }catch (Zend_Exception $e) { + echo "Error message 1: " . $e->getMessage() . "\n"; + } + switch($filterentryID){ + default: + $desc = "Select the filtertype"; + $label1 = 'Value 1:'; + $label2 = 'Value 2:'; + break; + case "1": + $desc = "You can set one IP or an IP-Range"; + $label1 = 'Start:'; + $label2 = 'End:'; + break; + case "2": + $desc = "You can set one Mac-Adress or an Mac-Range"; + $label1 = 'Start:'; + $label2 = 'End:'; + break; + case "3": + $desc = "Select your Pool"; + $label1 = 'PoolID:'; + break; + case "4": + $desc = "Select your BootIso"; + $label1 = 'BootIsoID:'; + break; + case "5": + $desc = "Select a Membership"; + $label1 = 'Membership:'; + break; + case "6": + $desc = "Select a Group"; + $label1 = 'Group:'; + break; + case "7": + $desc = "Specify a time-range"; + $label1 = 'Start:'; + $label2 = 'End:'; + break; + case "8": + $desc = "Select a Client"; + $label1 = 'Client:'; + break; + case "9": + $desc = "Define a Hardwarehash"; + $label1 = 'Hardwarehash:'; + break; + case "10": + $desc = "Specify the Weekday (Monday:1, Tuesday:2 ... Sunday:7) or a range"; + $label1 = 'Start Day:'; + $label2 = 'End Day:'; + break; + case "11": + $desc = "Specify the date or a day range of the filter"; + $label1 = 'Start Date:'; + $label2 = 'End Date:'; + break; + } + $filtertypes->setDescription($desc); + $this->addElement($filtertypes); + + $this->addElement('text', 'filtervalue', array( + 'label' => $label1, + 'id' => 'val1' + )); + + if(!in_array($filterentryID,array(3,4,5,6,8,9))){ + $this->addElement('text', 'filtervalue2', array( + 'label' => $label2, + 'id' => 'val2' + )); + } + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/filter"' + )); + + $this->addElement('hidden', 'filterID', array( + 'value' => $this->filterID + )); + + + } + + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + private $data ; + function setData($v){ + $this->data = $v; + } + function setFilterID($v){ + $this->filterID = $v; + } +} + +?> + diff --git a/application/modules/dev/forms/FilterEvaluate.php b/application/modules/dev/forms/FilterEvaluate.php new file mode 100644 index 0000000..b7c2b51 --- /dev/null +++ b/application/modules/dev/forms/FilterEvaluate.php @@ -0,0 +1,130 @@ +setName("Test Filter"); + $this->setMethod('post'); + $this->setAction('/filter/evaluate'); + + $this->addElement('text', 'ip', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'IP:', + )); + ###################################### + $this->addElement('text', 'mac', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Mac:', + )); + ###################################### + $poolfield = $this->createElement('select','poolID'); + $poolfield ->setLabel('Pool:'); + $poolfield->addMultiOption('',''); + if(count($this->pools)>0){ + foreach($this->pools as $id => $g){ + $poolfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $poolfield->setRegisterInArrayValidator(false); + $this->addElement($poolfield); + ###################################### + $bootisofield = $this->createElement('select','bootisoID'); + $bootisofield ->setLabel('BootIso:'); + $bootisofield->addMultiOption('',''); + if(count($this->bootisos)>0){ + foreach($this->bootisos as $id => $g){ + $bootisofield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootisofield->setRegisterInArrayValidator(false); + $this->addElement($bootisofield); + ###################################### + $membershipfield = $this->createElement('select','membershipID'); + $membershipfield ->setLabel('Membership:'); + $membershipfield->addMultiOption('',''); + if(count($this->memberships)>0){ + foreach($this->memberships as $id => $g){ + $membershipfield->addMultiOption($g->getID(), $g->getPersonID()); + } + } + $membershipfield->setRegisterInArrayValidator(false); + $this->addElement($membershipfield); + ###################################### + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + $groupfield->addMultiOption('',''); + if(count($this->groups)>0){ + foreach($this->groups as $id => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + ###################################### + $this->addElement('text', 'time', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Time:', + )); + ###################################### + $clientfield = $this->createElement('select','clientID'); + $clientfield ->setLabel('Client:'); + $clientfield->addMultiOption('',''); + if(count($this->clients)>0){ + foreach($this->clients as $id => $g){ + $clientfield->addMultiOption($g->getID(), $g->getID() . " - " . $g->getMacadress()); + } + } + $clientfield->setRegisterInArrayValidator(false); + $this->addElement($clientfield); + ###################################### + $this->addElement('text', 'hardwarehash', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Hardwarehash:', + )); + + $this->addElement('submit', 'submit', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Get It On!', + )); + } + function setPools($v){ + $this->pools = $v; + } + function setBootisos($v){ + $this->bootisos = $v; + } + function setMemberships($v){ + $this->memberships = $v; + } + function setGroups($v){ + $this->groups = $v; + } + function setClients($v){ + $this->clients = $v; + } +} + diff --git a/application/modules/dev/forms/GroupAdd.php b/application/modules/dev/forms/GroupAdd.php new file mode 100644 index 0000000..7df3af5 --- /dev/null +++ b/application/modules/dev/forms/GroupAdd.php @@ -0,0 +1,65 @@ +grouplist = $grouplist; + + } + + + public function init() + { + $this->setName("GroupAdd"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + $this->addElement('text', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'label' => 'Description:', + )); + + $groupfield = $this->createElement('select','superordinatedGroupID'); + $groupfield ->setLabel('superordinated Group:'); + + $groupfield->addMultiOption('-1', '---- none ----'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Add', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/group/show"', + )); + } + + +} + diff --git a/application/modules/dev/forms/GroupEdit.php b/application/modules/dev/forms/GroupEdit.php new file mode 100644 index 0000000..ef38d83 --- /dev/null +++ b/application/modules/dev/forms/GroupEdit.php @@ -0,0 +1,52 @@ +setName("GroupEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + 'value' => $_POST['title'], + )); + + $this->addElement('text', 'description', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 140)), + ), + 'required' => false, + 'label' => 'Description:', + 'value' => $_POST['description'], + )); + + $this->addElement('hidden', 'groupID', array( + 'value' => $_POST['groupID'], + )); + + $this->addElement('submit', 'save', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/group/show"', + )); + } + + +} + diff --git a/application/modules/dev/forms/GroupLink.php b/application/modules/dev/forms/GroupLink.php new file mode 100644 index 0000000..231c4a7 --- /dev/null +++ b/application/modules/dev/forms/GroupLink.php @@ -0,0 +1,55 @@ +grouplist = $grouplist; + + } + + public function init() + { + $this->setName("GroupLink"); + $this->setMethod('post'); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $groupfield1 = $this->createElement('select','superordinatedGroupID'); + $groupfield1 ->setLabel('superordinated Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield1->addMultiOption($g->getID(), $g->getTitle()); + } + } + $groupfield1->setRegisterInArrayValidator(false); + $this->addElement($groupfield1); + + $this->addElement('submit', 'link', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Link', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/group/show"', + )); + } + + +} + diff --git a/application/modules/dev/forms/GroupRequest.php b/application/modules/dev/forms/GroupRequest.php new file mode 100644 index 0000000..ec717de --- /dev/null +++ b/application/modules/dev/forms/GroupRequest.php @@ -0,0 +1,42 @@ +grouplist = $grouplist; + + } + + public function getGrouplist(){ + return $this->grouplist; + } + + public function init() + { + $this->setName("GroupRequest"); + $this->setMethod('post'); + + $groupfield = $this->createElement('select','groupID'); + $groupfield ->setLabel('Group:'); + + if(count($this->grouplist)>0){ + foreach($this->grouplist as $group => $g){ + $groupfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + + $groupfield->setRegisterInArrayValidator(false); + $this->addElement($groupfield); + + $this->addElement('submit', 'request', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Request Membership', + )); + + } + +} + diff --git a/application/modules/dev/forms/PersonEdit.php b/application/modules/dev/forms/PersonEdit.php new file mode 100644 index 0000000..664daac --- /dev/null +++ b/application/modules/dev/forms/PersonEdit.php @@ -0,0 +1,117 @@ +setName("PersonEdit"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + 'value' => $this->getView()->person->getTitle(), + )); + + + $this->addElement('text', 'name', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Name:', + 'value' => $this->getView()->person->getName(), + )); + + $this->addElement('text', 'firstname', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Firstname:', + 'value' => $this->getView()->person->getFirstname(), + )); + + $this->addElement('text', 'street', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Street:', + 'value' => $this->getView()->person->getStreet(), + )); + + $this->addElement('text', 'housenumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Housenumber:', + 'value' => $this->getView()->person->getHousenumber(), + )); + + $this->addElement('text', 'city', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'City:', + 'value' => $this->getView()->person->getCity(), + )); + + $this->addElement('text', 'postalcode', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Postalcode:', + 'value' => $this->getView()->person->getPostalcode(), + )); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Email:', + 'value' => $this->getView()->person->getEmail(), + )); + + $this->addElement('password', 'newpassword', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'Neues Password:', + )); + + $this->addElement('submit', 'save', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + + $this->addElement('button', 'cancel', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Cancel', + 'onclick' => 'location.href="/person/show"', + )); + } + + +} + diff --git a/application/modules/dev/forms/Pool.php b/application/modules/dev/forms/Pool.php new file mode 100644 index 0000000..be30444 --- /dev/null +++ b/application/modules/dev/forms/Pool.php @@ -0,0 +1,52 @@ +setName("pool"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + $this->addElement('textarea', 'description', array( + 'filters' => array('StringTrim'), + 'required' => false, + 'label' => 'Description:', + )); + // TODO: Add target of Filter + + $this->addElement('text', 'location', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Location:', + )); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/pool"' + )); + } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + + +} + diff --git a/application/modules/dev/forms/PoolClient.php b/application/modules/dev/forms/PoolClient.php new file mode 100644 index 0000000..0c4ef6a --- /dev/null +++ b/application/modules/dev/forms/PoolClient.php @@ -0,0 +1,32 @@ +setName("addClientToPool"); + $this->setMethod('post'); + + $clientfield = $this->createElement('select','clientID'); + $clientfield ->setLabel('Client:'); + print_a($this->clients); + foreach($this->clients as $c){ + $clientfield->addMultiOption($c['clientID'],$c['macadress']." - ".$c['hardwarehash']); + } + $this->addElement($clientfield); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Save', + )); + } + public function setClients($clients){ + $this->clients = $clients; + return $this; + } + +} + diff --git a/application/modules/dev/forms/Session.php b/application/modules/dev/forms/Session.php new file mode 100644 index 0000000..8603f75 --- /dev/null +++ b/application/modules/dev/forms/Session.php @@ -0,0 +1,139 @@ +setName("session"); + $this->setMethod('post'); + + $this->addElement('text', 'alphasessionID', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 16)), + ), + 'required' => false, + 'label' => 'alphasessionID:', + )); + + $clientfield = $this->createElement('select','clientID'); + $clientfield ->setLabel('Client:'); + $clientfield->addMultiOption('',''); + if(count($this->clients)>0){ + foreach($this->clients as $id => $g){ + $clientfield->addMultiOption($g->getID(), $g->getMacadress()); + } + } + $clientfield->setRegisterInArrayValidator(false); + $this->addElement($clientfield); + + + $bootmenuentrieyfield = $this->createElement('select','bootmenuentryID'); + $bootmenuentrieyfield->setLabel('BootmenuentryID:'); + $bootmenuentrieyfield->addMultiOption('',''); + if(count($this->bootmenuentries)>0){ + foreach($this->bootmenuentries as $id => $g){ + $bootmenuentrieyfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootmenuentrieyfield->setRegisterInArrayValidator(false); + $this->addElement($bootmenuentrieyfield); + + + $bootosfield = $this->createElement('select','bootosID'); + $bootosfield ->setLabel('BootOs:'); + $bootosfield->addMultiOption('',''); + if(count($this->bootos)>0){ + foreach($this->bootos as $id => $g){ + $bootosfield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootosfield->setRegisterInArrayValidator(false); + $this->addElement($bootosfield); + + $bootisofield = $this->createElement('select','bootisoID'); + $bootisofield ->setLabel('BootIso:'); + if(count($this->bootisos)>0){ + foreach($this->bootisos as $id => $g){ + $bootisofield->addMultiOption($g->getID(), $g->getTitle()); + } + } + $bootisofield->setRegisterInArrayValidator(false); + $this->addElement($bootisofield); + + $membershipfield = $this->createElement('select','membershipID'); + $membershipfield ->setLabel('Membership:'); + $membershipfield ->addMultiOption('',''); + if(count($this->memberships)>0){ + foreach($this->memberships as $id => $g){ + $membershipfield->addMultiOption($g->getID(), $g->getPersonID()); + } + } + $membershipfield->setRegisterInArrayValidator(false); + $this->addElement($membershipfield); + +$this->addElement('text', 'time', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'time:', + )); +$this->addElement('text', 'ip', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'ip:', + )); +$this->addElement('text', 'ip6', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => false, + 'label' => 'ip6:', + )); + + $this->addElement('submit', 'add', array( + 'required' => false, + 'ignore' => true, + 'label' => $this->buttontext, + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/session"' + )); + } + function setClients($v){ + $this->clients = $v; + } + function setBootos($v){ + $this->bootos = $v; + } + function setBootisos($v){ + $this->bootisos = $v; + } + function setBootmenuentries($v){ + $this->bootmenuentries = $v; + } + function setMemberships($v){ + $this->memberships = $v; + } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } + + +} + diff --git a/application/modules/dev/views/scripts/auth/delete.phtml b/application/modules/dev/views/scripts/auth/delete.phtml new file mode 100644 index 0000000..e69de29 diff --git a/application/modules/dev/views/scripts/auth/index.phtml b/application/modules/dev/views/scripts/auth/index.phtml new file mode 100644 index 0000000..e69de29 diff --git a/application/modules/dev/views/scripts/auth/login.phtml b/application/modules/dev/views/scripts/auth/login.phtml new file mode 100644 index 0000000..4e642a3 --- /dev/null +++ b/application/modules/dev/views/scripts/auth/login.phtml @@ -0,0 +1,5 @@ +loginForm->setAction($this->url()); +echo $this->loginForm; +?> +
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/auth/logout.phtml b/application/modules/dev/views/scripts/auth/logout.phtml new file mode 100644 index 0000000..a709bd9 --- /dev/null +++ b/application/modules/dev/views/scripts/auth/logout.phtml @@ -0,0 +1 @@ +

View script for controller Auth and script/action name logout
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/auth/recoverpassword.phtml b/application/modules/dev/views/scripts/auth/recoverpassword.phtml new file mode 100644 index 0000000..881e00e --- /dev/null +++ b/application/modules/dev/views/scripts/auth/recoverpassword.phtml @@ -0,0 +1,4 @@ +recoverPasswordForm->setAction($this->url()); +echo $this->recoverPasswordForm; +?> diff --git a/application/modules/dev/views/scripts/auth/register.phtml b/application/modules/dev/views/scripts/auth/register.phtml new file mode 100644 index 0000000..5196738 --- /dev/null +++ b/application/modules/dev/views/scripts/auth/register.phtml @@ -0,0 +1,4 @@ +registerForm->setAction($this->url()); +echo $this->registerForm; +?> diff --git a/application/modules/dev/views/scripts/bootiso/createbootiso.phtml b/application/modules/dev/views/scripts/bootiso/createbootiso.phtml new file mode 100644 index 0000000..a5ad609 --- /dev/null +++ b/application/modules/dev/views/scripts/bootiso/createbootiso.phtml @@ -0,0 +1,4 @@ +createbootisoForm->setAction($this->url()); +echo $this->createbootisoForm; +?> diff --git a/application/modules/dev/views/scripts/bootiso/editbootiso.phtml b/application/modules/dev/views/scripts/bootiso/editbootiso.phtml new file mode 100644 index 0000000..9b04c95 --- /dev/null +++ b/application/modules/dev/views/scripts/bootiso/editbootiso.phtml @@ -0,0 +1,4 @@ +editbootisoForm->setAction($this->url()); +echo $this->editbootisoForm; +?> diff --git a/application/modules/dev/views/scripts/bootiso/index.phtml b/application/modules/dev/views/scripts/bootiso/index.phtml new file mode 100644 index 0000000..5e7da1e --- /dev/null +++ b/application/modules/dev/views/scripts/bootiso/index.phtml @@ -0,0 +1,56 @@ +

BootISO

+formButton('createbootiso', 'Create BootISO', array( + 'onclick' => 'self.location="/bootiso/createbootiso"', + 'class' => 'addbutton'))?> + + + + + + + + + + + + + + bootisolist)==0) + echo "
IDTitleGroupIDMembershipIDPathSerialnumberCreatedExpiresPublicActions
There are no BootISO's entries for the Bootmenuto display." ?> + bootisolist as $bootiso): ?> + + escape($bootiso->getID()); ?> + escape($bootiso->getTitle()); ?> + escape($bootiso->getGroupID()); ?> + escape($bootiso->getMembershipID()); ?> + escape($bootiso->getPath()); ?> + escape($bootiso->getSerialnumber()); ?> + escape(date('Y-m-d H:i:s', $bootiso->getCreated())); ?> + escape($bootiso->getExpires()); ?> + escape($bootiso->getPublic()); ?> + Edit BootISO + Delete BootISO + + + + + + + + + + diff --git a/application/modules/dev/views/scripts/bootmenu/addbootmenuentry.phtml b/application/modules/dev/views/scripts/bootmenu/addbootmenuentry.phtml new file mode 100644 index 0000000..914cc9c --- /dev/null +++ b/application/modules/dev/views/scripts/bootmenu/addbootmenuentry.phtml @@ -0,0 +1,4 @@ +addbootmenuentryForm->setAction($this->url()); +echo $this->addbootmenuentryForm; +?> \ No newline at end of file diff --git a/application/modules/dev/views/scripts/bootmenu/createbootmenu.phtml b/application/modules/dev/views/scripts/bootmenu/createbootmenu.phtml new file mode 100644 index 0000000..2d2c2df --- /dev/null +++ b/application/modules/dev/views/scripts/bootmenu/createbootmenu.phtml @@ -0,0 +1,4 @@ +createbootmenuForm->setAction($this->url()); +echo $this->createbootmenuForm; +?> diff --git a/application/modules/dev/views/scripts/bootmenu/editbootmenu.phtml b/application/modules/dev/views/scripts/bootmenu/editbootmenu.phtml new file mode 100644 index 0000000..b7adc4a --- /dev/null +++ b/application/modules/dev/views/scripts/bootmenu/editbootmenu.phtml @@ -0,0 +1,4 @@ +editbootmenuForm->setAction($this->url()); +echo $this->editbootmenuForm; +?> diff --git a/application/modules/dev/views/scripts/bootmenu/editbootmenuentry.phtml b/application/modules/dev/views/scripts/bootmenu/editbootmenuentry.phtml new file mode 100644 index 0000000..5680d65 --- /dev/null +++ b/application/modules/dev/views/scripts/bootmenu/editbootmenuentry.phtml @@ -0,0 +1,4 @@ +editbootmenuentryForm->setAction($this->url()); +echo $this->editbootmenuentryForm; +?> \ No newline at end of file diff --git a/application/modules/dev/views/scripts/bootmenu/index.phtml b/application/modules/dev/views/scripts/bootmenu/index.phtml new file mode 100644 index 0000000..fa722e4 --- /dev/null +++ b/application/modules/dev/views/scripts/bootmenu/index.phtml @@ -0,0 +1,119 @@ +

BootMenu

+formButton('createbootmenu', 'Create BootMenu', array( + 'onclick' => 'self.location="/bootmenu/createbootmenu"', + 'class' => 'addbutton'))?> + + + + + + + + + + + + bootmenulist)==0) + echo "
IDTitleGroupIDMembershipIDChangedActions
There are no BootMenus to display." ?> + bootmenulist as $bootmenu): ?> + + escape($bootmenu->getID()); ?> + escape($bootmenu->getTitle()); ?> + escape($bootmenu->getGroupID()); ?> + escape($bootmenu->getMembershipID()); ?> + escape(date('Y-m-d H:i:s', $bootmenu->getCreated())); ?> + Edit Bootmenu + Delete Bootmenu + Add Entry + + +bootmenuentrylist[$bootmenu->getID()]) > 0):?> + + ↳ + + + + + + + + + + + + + + + + bootmenuentrylist[$bootmenu->getID()] as $bootmenuentry): ?> + bootosmapper->find($bootmenuentry->getBootosID());?> + configmapper->find($bootmenuentry->getConfigID());?> + + + + + + + + + + + + +
IDTitleBootOSkclConfigPositionActions
+ + + + escape($bootmenuentry->getID()); ?>escape($bootmenuentry->getTitle()); ?>escape($bootmenuentry->getBootosID()."] ". $bootos->getTitle()); ?>escape($bootmenuentry->getkcl()); ?>escape($bootmenuentry->getConfigID()."] ". $config->getTitle()); ?>escape($bootmenuentry->getOrder() + 1); ?>Edit EntryRemove Entry
+ + + + + + + + + + + + diff --git a/application/modules/dev/views/scripts/bootos/createbootos.phtml b/application/modules/dev/views/scripts/bootos/createbootos.phtml new file mode 100644 index 0000000..3d35695 --- /dev/null +++ b/application/modules/dev/views/scripts/bootos/createbootos.phtml @@ -0,0 +1,4 @@ +createbootosForm->setAction($this->url()); +echo $this->createbootosForm; +?> diff --git a/application/modules/dev/views/scripts/bootos/editbootos.phtml b/application/modules/dev/views/scripts/bootos/editbootos.phtml new file mode 100644 index 0000000..43813de --- /dev/null +++ b/application/modules/dev/views/scripts/bootos/editbootos.phtml @@ -0,0 +1,4 @@ +editbootosForm->setAction($this->url()); +echo $this->editbootosForm; +?> diff --git a/application/modules/dev/views/scripts/bootos/index.phtml b/application/modules/dev/views/scripts/bootos/index.phtml new file mode 100644 index 0000000..6da7a16 --- /dev/null +++ b/application/modules/dev/views/scripts/bootos/index.phtml @@ -0,0 +1,62 @@ +

BootOS

+formButton('createbootos', 'Create BootOS', array( + 'onclick' => 'self.location="/bootos/createbootos"', + 'class' => 'addbutton'))?> + + + + + + + + + + + + + + + + + + bootoslist)==0) + echo "
IDTitleGroupIDMembershipIDConfigIDInitKernelKclDescriptionChangedExpiresPublicActions
There are no BootOs's to display." ?> + bootoslist as $bootos): ?> + + escape($bootos->getID()); ?> + escape($bootos->getTitle()); ?> + escape($bootos->getGroupID()); ?> + escape($bootos->getMembershipID()); ?> + escape($bootos->getConfigID()); ?> + escape($bootos->getPath_init()); ?> + escape($bootos->getPath_kernel()); ?> + escape($bootos->getDefaultkcl()); ?> + escape($bootos->getDescription()); ?> + escape(date('Y-m-d H:i:s', $bootos->getCreated())); ?> + escape($bootos->getExpires()); ?> + escape($bootos->getPublic()); ?> + Edit BootOS + Delete BootOS + + + + + + + + + diff --git a/application/modules/dev/views/scripts/client/addclient.phtml b/application/modules/dev/views/scripts/client/addclient.phtml new file mode 100644 index 0000000..e5b0bcf --- /dev/null +++ b/application/modules/dev/views/scripts/client/addclient.phtml @@ -0,0 +1,3 @@ +addclient; diff --git a/application/modules/dev/views/scripts/client/editclient.phtml b/application/modules/dev/views/scripts/client/editclient.phtml new file mode 100644 index 0000000..94d6b34 --- /dev/null +++ b/application/modules/dev/views/scripts/client/editclient.phtml @@ -0,0 +1,3 @@ +editclient; diff --git a/application/modules/dev/views/scripts/client/index.phtml b/application/modules/dev/views/scripts/client/index.phtml new file mode 100644 index 0000000..fd7725c --- /dev/null +++ b/application/modules/dev/views/scripts/client/index.phtml @@ -0,0 +1,44 @@ +

Clients

+formButton('createbootos', 'Create Client', array( + 'onclick' => 'self.location="/client/addclient"', + 'class' => 'addbutton'))?> + +clients): ?> + + + + + + + + clients as $client): ?> + + + + + + + + +
IDMACHardwarehashActions
escape($client->getID()) ?>escape($client->getMacadress()) ?>escape($client->getHardwarehash()) ?>Edit ClientDelete Client
+ + + + +

There are no clients to display.

+ + diff --git a/application/modules/dev/views/scripts/client/removeclient.phtml b/application/modules/dev/views/scripts/client/removeclient.phtml new file mode 100644 index 0000000..7b5f64f --- /dev/null +++ b/application/modules/dev/views/scripts/client/removeclient.phtml @@ -0,0 +1 @@ +

View script for controller Client and script/action name deleteclient
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/config/createconfig.phtml b/application/modules/dev/views/scripts/config/createconfig.phtml new file mode 100644 index 0000000..e6edf7b --- /dev/null +++ b/application/modules/dev/views/scripts/config/createconfig.phtml @@ -0,0 +1,4 @@ +createconfigForm->setAction($this->url()); +echo $this->createconfigForm; +?> diff --git a/application/modules/dev/views/scripts/config/editconfig.phtml b/application/modules/dev/views/scripts/config/editconfig.phtml new file mode 100644 index 0000000..4971f2e --- /dev/null +++ b/application/modules/dev/views/scripts/config/editconfig.phtml @@ -0,0 +1,4 @@ +editconfigForm->setAction($this->url()); +echo $this->editconfigForm; +?> diff --git a/application/modules/dev/views/scripts/config/index.phtml b/application/modules/dev/views/scripts/config/index.phtml new file mode 100644 index 0000000..5562b86 --- /dev/null +++ b/application/modules/dev/views/scripts/config/index.phtml @@ -0,0 +1,50 @@ +

Config

+formButton('createconfig', 'Create Config', array( + 'onclick' => 'self.location="/config/createconfig"', + 'class' => 'addbutton'))?> + + + + + + + + + + + + configlist)==0) + echo "
IDTitleGroupIDMembershipIDShellscriptChangedActions
There are no Config's to display." ?> + configlist as $config): ?> + + escape($config->getID()); ?> + escape($config->getTitle()); ?> + escape($config->getGroupID()); ?> + escape($config->getMembershipID()); ?> + escape($config->getShellscript()); ?> + escape(date('Y-m-d H:i:s', $config->getCreated())); ?> + Edit Config + Delete Config + + + + + + + + + diff --git a/application/modules/dev/views/scripts/error/error.phtml b/application/modules/dev/views/scripts/error/error.phtml new file mode 100644 index 0000000..1997506 --- /dev/null +++ b/application/modules/dev/views/scripts/error/error.phtml @@ -0,0 +1,28 @@ + + + + + Zend Framework Default Application + + +

An error occurred

+

message ?>

+ + exception)): ?> + +

Exception information:

+

+ Message: exception->getMessage() ?> +

+ +

Stack trace:

+
exception->getTraceAsString() ?>
+  
+ +

Request Parameters:

+
request->getParams(), true) ?>
+  
+ + + + diff --git a/application/modules/dev/views/scripts/filter/addfilter.phtml b/application/modules/dev/views/scripts/filter/addfilter.phtml new file mode 100644 index 0000000..40b4ccf --- /dev/null +++ b/application/modules/dev/views/scripts/filter/addfilter.phtml @@ -0,0 +1,3 @@ +addfilterform->setAction($this->url()); +echo $this->addfilterform; diff --git a/application/modules/dev/views/scripts/filter/addfilterentry.phtml b/application/modules/dev/views/scripts/filter/addfilterentry.phtml new file mode 100644 index 0000000..8bf501a --- /dev/null +++ b/application/modules/dev/views/scripts/filter/addfilterentry.phtml @@ -0,0 +1,3 @@ +editfilterform->setAction($this->url()); +echo $this->editfilterform; diff --git a/application/modules/dev/views/scripts/filter/editfilter.phtml b/application/modules/dev/views/scripts/filter/editfilter.phtml new file mode 100644 index 0000000..8bc38f7 --- /dev/null +++ b/application/modules/dev/views/scripts/filter/editfilter.phtml @@ -0,0 +1,8 @@ +

Edit Filter

+editfilterform->setAction($this->url()); +echo $this->editfilterform; + + +?> diff --git a/application/modules/dev/views/scripts/filter/editfilterentry.phtml b/application/modules/dev/views/scripts/filter/editfilterentry.phtml new file mode 100644 index 0000000..038f16a --- /dev/null +++ b/application/modules/dev/views/scripts/filter/editfilterentry.phtml @@ -0,0 +1,2 @@ +editfilterform; diff --git a/application/modules/dev/views/scripts/filter/evaluate.phtml b/application/modules/dev/views/scripts/filter/evaluate.phtml new file mode 100644 index 0000000..e69de29 diff --git a/application/modules/dev/views/scripts/filter/index.phtml b/application/modules/dev/views/scripts/filter/index.phtml new file mode 100644 index 0000000..188bed3 --- /dev/null +++ b/application/modules/dev/views/scripts/filter/index.phtml @@ -0,0 +1,117 @@ +

Filters

+formButton('createconfig', 'Create Filter', array( + 'onclick' => 'self.location="/filter/addfilter"', + 'class' => 'addbutton'))?> + +filters): ?> + + + + + + + + + + filters as $filter): ?> + + + + + + + + + + + findBy('filterID',$filter->getID())); + $erg = $fe->findBy('filterID',$filter->getID()); + ?> + 0): ?> + + + + + + +
IDTitleDescriptionPriorityTargetBootMenuActions
escape($filter->getID()) ?>escape($filter->title) ?>escape($filter->Description) ?>escape($filter->priority) ?>escape($filter->bootmenuID) ?>Edit FilterDelete FilterAdd Filterentry
+ + + + + + + + + + + + + + + + + +
FiltertypeValueValue2Actions
find($filterentry['filtertypeID'],$erg); + //name zur ID finden + echo "[".$filterentry['filtertypeID']."] "; + echo $erg->getFiltertypename(); + + + ?>Edit Filterentry + Delete Filterentry +
+
+ + + + +

There are no filters to display.

+ + +formButton('createconfig', 'Test Filters', array( + 'onclick' => 'self.location="/filter/testevaluate"', + 'class' => 'addbutton'))?> diff --git a/application/modules/dev/views/scripts/filter/testevaluate.phtml b/application/modules/dev/views/scripts/filter/testevaluate.phtml new file mode 100644 index 0000000..8a10629 --- /dev/null +++ b/application/modules/dev/views/scripts/filter/testevaluate.phtml @@ -0,0 +1,4 @@ +

Test Filters

+ +filterevaluate; diff --git a/application/modules/dev/views/scripts/group/add.phtml b/application/modules/dev/views/scripts/group/add.phtml new file mode 100644 index 0000000..4f96cf0 --- /dev/null +++ b/application/modules/dev/views/scripts/group/add.phtml @@ -0,0 +1,4 @@ +addForm->setAction($this->url()); +echo $this->addForm; +?> \ No newline at end of file diff --git a/application/modules/dev/views/scripts/group/delete.phtml b/application/modules/dev/views/scripts/group/delete.phtml new file mode 100644 index 0000000..fc96431 --- /dev/null +++ b/application/modules/dev/views/scripts/group/delete.phtml @@ -0,0 +1,6 @@ + +
No group has been chosen.
+ addForm)) { + $this->addForm->setAction('/group/add'); + echo $this->addForm; +} +else { + $this->editForm->setAction($this->url()); + echo $this->editForm; +} +?> \ No newline at end of file diff --git a/application/modules/dev/views/scripts/group/grantperson.phtml b/application/modules/dev/views/scripts/group/grantperson.phtml new file mode 100644 index 0000000..f15d08a --- /dev/null +++ b/application/modules/dev/views/scripts/group/grantperson.phtml @@ -0,0 +1,11 @@ + +
No Request has been chosen.
+ +
No Role has been chosen.
+ + + Title: + Functions: + + groupList as $group) { + ?> + + getTitle(); ?> + +
Details
+
Edit
+
Delete
+ + + + +
+
+ +
diff --git a/application/modules/dev/views/scripts/group/link.phtml b/application/modules/dev/views/scripts/group/link.phtml new file mode 100644 index 0000000..94ad343 --- /dev/null +++ b/application/modules/dev/views/scripts/group/link.phtml @@ -0,0 +1,4 @@ +linkForm->setAction($this->url()); +echo $this->linkForm; +?> \ No newline at end of file diff --git a/application/modules/dev/views/scripts/group/revokeperson.phtml b/application/modules/dev/views/scripts/group/revokeperson.phtml new file mode 100644 index 0000000..6af5564 --- /dev/null +++ b/application/modules/dev/views/scripts/group/revokeperson.phtml @@ -0,0 +1,6 @@ + +
No Membership has been chosen.
+ +
+
+
+
+ + + + + + + + + + + + + + + +
Title:group->getTitle(); ?>
Description:group->getDescription(); ?>
Superordinated Group:parentGroup->getTitle(); ?>
+ groupRequestList)) { + ?> +
+
Grouprequests:
+
+ + + + + + + + + groupRequestList as $grouprequest) { + $grouprequestID = $grouprequest['grouprequestID']; + $person = $grouprequest['person']; + ?> + + + + + + + + +
Firstname:Name:email:city:grant:
getFirstname(); ?>getName(); ?>getEmail(); ?>getCity(); ?> +
roleList); ?> +
+
+ memberslist)) { + ?> +
+
Members:
+
+ + + + + + + + + + memberslist as $member) { + $membershipID = $member['membershipID']; + $person = $member['person']; + ?> + + + + + + + + +
Firstname:Name:email:city:
getFirstname(); ?>getName(); ?>getEmail(); ?>getCity(); ?> +
+
+
+ +
No Group has been chosen.
+ "; + foreach($roleList as $role) { + echo ""; + } + echo ""; +} \ No newline at end of file diff --git a/application/modules/dev/views/scripts/index/index.phtml b/application/modules/dev/views/scripts/index/index.phtml new file mode 100644 index 0000000..57e6edb --- /dev/null +++ b/application/modules/dev/views/scripts/index/index.phtml @@ -0,0 +1 @@ +

Welcome

diff --git a/application/modules/dev/views/scripts/person/edit.phtml b/application/modules/dev/views/scripts/person/edit.phtml new file mode 100644 index 0000000..955ed35 --- /dev/null +++ b/application/modules/dev/views/scripts/person/edit.phtml @@ -0,0 +1,4 @@ +editForm->setAction($this->url()); +echo $this->editForm; +?> \ No newline at end of file diff --git a/application/modules/dev/views/scripts/person/index.phtml b/application/modules/dev/views/scripts/person/index.phtml new file mode 100644 index 0000000..e69de29 diff --git a/application/modules/dev/views/scripts/person/leave.phtml b/application/modules/dev/views/scripts/person/leave.phtml new file mode 100644 index 0000000..fc96431 --- /dev/null +++ b/application/modules/dev/views/scripts/person/leave.phtml @@ -0,0 +1,6 @@ + +
No group has been chosen.
+ requestForm->getGrouplist())>0) { + $this->requestForm->setAction($this->url()); + echo $this->requestForm; +} +?> \ No newline at end of file diff --git a/application/modules/dev/views/scripts/person/show.phtml b/application/modules/dev/views/scripts/person/show.phtml new file mode 100644 index 0000000..5386c06 --- /dev/null +++ b/application/modules/dev/views/scripts/person/show.phtml @@ -0,0 +1,79 @@ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Title:person->getTitle(); ?>
Name:person->getName(); ?>
Firstname:person->getFirstname(); ?>
Street:person->getStreet(); ?>
Housenumber:person->getHousenumber(); ?>
City:person->getCity(); ?>
Postalcode:person->getPostalcode(); ?>
Email:person->getEmail(); ?>
Last Login Date:person->getLogindate()) echo date ('d. F Y - H:i', $this->person->getLogindate()); ?> Uhr
Register Date:person->getRegisterdate()); ?> Uhr
+groups)) { + ?> +
+
Member in the following Groups:
+
+ +groups as $group) { + ?> + + + + + + + + + +
TitleFunctions
+
Remove + Membership
+
+
+
+ +
diff --git a/application/modules/dev/views/scripts/pool/createpool.phtml b/application/modules/dev/views/scripts/pool/createpool.phtml new file mode 100644 index 0000000..305b36e --- /dev/null +++ b/application/modules/dev/views/scripts/pool/createpool.phtml @@ -0,0 +1,2 @@ +addpool; diff --git a/application/modules/dev/views/scripts/pool/deletepool.phtml b/application/modules/dev/views/scripts/pool/deletepool.phtml new file mode 100644 index 0000000..622e663 --- /dev/null +++ b/application/modules/dev/views/scripts/pool/deletepool.phtml @@ -0,0 +1 @@ +

View script for controller Pool and script/action name deletepool
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/pool/editpool.phtml b/application/modules/dev/views/scripts/pool/editpool.phtml new file mode 100644 index 0000000..359a5f9 --- /dev/null +++ b/application/modules/dev/views/scripts/pool/editpool.phtml @@ -0,0 +1,4 @@ +

Edit Pool

+editpoolform; diff --git a/application/modules/dev/views/scripts/pool/index.phtml b/application/modules/dev/views/scripts/pool/index.phtml new file mode 100644 index 0000000..2c6ba16 --- /dev/null +++ b/application/modules/dev/views/scripts/pool/index.phtml @@ -0,0 +1,126 @@ +

Pools

+formButton('createconfig', 'Create Pool', array( + 'onclick' => 'self.location="/pool/createpool"', + 'class' => 'addbutton'))?> + +pools): ?> + + + + + + + + + pools as $pool): ?> + + + + + + + + + + findBy('poolID',$pool->getID()); + ?> + 0): ?> + + + + + + +
IDTitleDescriptionLocationActions
escape($pool->getID()) ?>escape($pool->getTitle()) ?>escape($pool->getDescription()) ?>escape($pool->getLocation()) ?>Edit PoolDelete PoolLink Client
+ + + + + + + + + + + find($client['clientID'],$cli); + ?> + + + + + +
ClientIDMacHardwarehashActions
macAdress); ?>hardwarehash); ?>Unlink Client
+
+

Free clients

+ + + + + + + +freeclients as $client): ?> + + + + + ?> + + + + + +
ClientIDMacAdressHardwarehashActions
+ + + +

There are no pools to display.

+ + diff --git a/application/modules/dev/views/scripts/pool/linkclient.phtml b/application/modules/dev/views/scripts/pool/linkclient.phtml new file mode 100644 index 0000000..cbd2dd4 --- /dev/null +++ b/application/modules/dev/views/scripts/pool/linkclient.phtml @@ -0,0 +1,3 @@ +

Link Clients

+poolclient; diff --git a/application/modules/dev/views/scripts/pool/unlinkclient.phtml b/application/modules/dev/views/scripts/pool/unlinkclient.phtml new file mode 100644 index 0000000..35aa9c5 --- /dev/null +++ b/application/modules/dev/views/scripts/pool/unlinkclient.phtml @@ -0,0 +1 @@ +

View script for controller Pool and script/action name unlinkclient
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/resource/get-bootmenu-entry.phtml b/application/modules/dev/views/scripts/resource/get-bootmenu-entry.phtml new file mode 100644 index 0000000..e69de29 diff --git a/application/modules/dev/views/scripts/resource/index.phtml b/application/modules/dev/views/scripts/resource/index.phtml new file mode 100644 index 0000000..e69de29 diff --git a/application/modules/dev/views/scripts/role/add.phtml b/application/modules/dev/views/scripts/role/add.phtml new file mode 100644 index 0000000..5277b9d --- /dev/null +++ b/application/modules/dev/views/scripts/role/add.phtml @@ -0,0 +1 @@ +

View script for controller Role and script/action name add
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/role/delete.phtml b/application/modules/dev/views/scripts/role/delete.phtml new file mode 100644 index 0000000..6b0ebf1 --- /dev/null +++ b/application/modules/dev/views/scripts/role/delete.phtml @@ -0,0 +1 @@ +

View script for controller Role and script/action name delete
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/role/edit.phtml b/application/modules/dev/views/scripts/role/edit.phtml new file mode 100644 index 0000000..c30d295 --- /dev/null +++ b/application/modules/dev/views/scripts/role/edit.phtml @@ -0,0 +1 @@ +

View script for controller Role and script/action name edit
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/role/index.phtml b/application/modules/dev/views/scripts/role/index.phtml new file mode 100644 index 0000000..d30131e --- /dev/null +++ b/application/modules/dev/views/scripts/role/index.phtml @@ -0,0 +1 @@ +

View script for controller Role and script/action name index
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/role/linkright.phtml b/application/modules/dev/views/scripts/role/linkright.phtml new file mode 100644 index 0000000..bfba9db --- /dev/null +++ b/application/modules/dev/views/scripts/role/linkright.phtml @@ -0,0 +1 @@ +

View script for controller Role and script/action name linkright
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/role/show.phtml b/application/modules/dev/views/scripts/role/show.phtml new file mode 100644 index 0000000..dcd232b --- /dev/null +++ b/application/modules/dev/views/scripts/role/show.phtml @@ -0,0 +1 @@ +

View script for controller Role and script/action name show
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/role/unlinkright.phtml b/application/modules/dev/views/scripts/role/unlinkright.phtml new file mode 100644 index 0000000..8c7615d --- /dev/null +++ b/application/modules/dev/views/scripts/role/unlinkright.phtml @@ -0,0 +1 @@ +

View script for controller Role and script/action name unlinkright
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/session/createsession.phtml b/application/modules/dev/views/scripts/session/createsession.phtml new file mode 100644 index 0000000..11fe7ce --- /dev/null +++ b/application/modules/dev/views/scripts/session/createsession.phtml @@ -0,0 +1,5 @@ +

create session

+ +createsession; +?> diff --git a/application/modules/dev/views/scripts/session/deletesession.phtml b/application/modules/dev/views/scripts/session/deletesession.phtml new file mode 100644 index 0000000..57f8698 --- /dev/null +++ b/application/modules/dev/views/scripts/session/deletesession.phtml @@ -0,0 +1 @@ +

View script for controller Session and script/action name deletesession
\ No newline at end of file diff --git a/application/modules/dev/views/scripts/session/editsession.phtml b/application/modules/dev/views/scripts/session/editsession.phtml new file mode 100644 index 0000000..88fb273 --- /dev/null +++ b/application/modules/dev/views/scripts/session/editsession.phtml @@ -0,0 +1,5 @@ +

edit session

+ +editsession; +?> diff --git a/application/modules/dev/views/scripts/session/index.phtml b/application/modules/dev/views/scripts/session/index.phtml new file mode 100644 index 0000000..c9f726b --- /dev/null +++ b/application/modules/dev/views/scripts/session/index.phtml @@ -0,0 +1,49 @@ +

Session

+formButton('createconfig', 'Create Session', array( + 'onclick' => 'self.location="/session/createsession"', + 'class' => 'addbutton'))?> + + + + + + + + + + + + + + +sessions as $session): ?> + + + + + + + + + + + + + + + +
IDalphasessionIDClientIDBootmenuentryIDBootOsIDBootIsoIDMembershipIDTimeIPIPv6Actions
escape($session->getID()) ?>escape($session->getAlphasessionID()) ?>escape($session->getClientID()) ?>escape($session->getBootmenuentryID()) ?>escape($session->getBootosID()) ?>escape($session->getBootisoID()) ?>escape($session->getMembershipID()) ?>escape($session->getTime())) ?>escape($session->getIp()) ?>escape($session->getIp6()) ?>Edit FilterDelete Filter
-- cgit v1.2.3-55-g7522