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/SessionController.php | 182 +++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 application/modules/dev/controllers/SessionController.php (limited to 'application/modules/dev/controllers/SessionController.php') 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'); + } + + +} + + + + + + + -- cgit v1.2.3-55-g7522 From d583d0071274a8843b3a3cd7b7ec72d5a9942f53 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 14 Mar 2011 16:17:48 +0100 Subject: Zweiter push um die änderungen hinzuzufügen, Trennung der Ansichten --- .gitignore | 1 + .zfproject.xml | 68 +++++++++++++++++++++- application/Bootstrap.php | 20 ++++++- application/configs/application.ini.dist | 1 + application/controllers/ErrorController.php | 52 +++++++++++++++++ application/controllers/IndexController.php | 22 +++++++ application/layouts/main.phtml | 30 +++++----- application/modules/dev/Bootstrap.php | 5 ++ .../modules/dev/controllers/AuthController.php | 16 ++--- .../modules/dev/controllers/BootisoController.php | 10 ++-- .../modules/dev/controllers/BootmenuController.php | 18 +++--- .../modules/dev/controllers/BootosController.php | 14 +++-- .../modules/dev/controllers/ClientController.php | 10 ++-- .../modules/dev/controllers/ConfigController.php | 10 ++-- .../modules/dev/controllers/ErrorController.php | 3 +- .../modules/dev/controllers/FilterController.php | 20 +++---- .../modules/dev/controllers/GroupController.php | 16 ++--- .../modules/dev/controllers/IndexController.php | 2 +- .../modules/dev/controllers/PersonController.php | 10 ++-- .../modules/dev/controllers/PoolController.php | 14 ++--- .../modules/dev/controllers/ResourceController.php | 2 +- .../modules/dev/controllers/RoleController.php | 2 +- .../modules/dev/controllers/SessionController.php | 10 ++-- application/modules/dev/forms/AuthDelete.php | 2 +- application/modules/dev/forms/AuthLogin.php | 2 +- .../modules/dev/forms/AuthRecoverPassword.php | 2 +- application/modules/dev/forms/AuthRegister.php | 2 +- application/modules/dev/forms/BootisoCreate.php | 2 +- application/modules/dev/forms/BootisoEdit.php | 2 +- application/modules/dev/forms/BootmenuCreate.php | 2 +- application/modules/dev/forms/BootmenuEdit.php | 2 +- .../modules/dev/forms/BootmenuEntriesAdd.php | 2 +- .../modules/dev/forms/BootmenuEntriesEdit.php | 2 +- application/modules/dev/forms/BootosCreate.php | 2 +- application/modules/dev/forms/BootosEdit.php | 2 +- application/modules/dev/forms/Client.php | 2 +- application/modules/dev/forms/ConfigCreate.php | 2 +- application/modules/dev/forms/ConfigEdit.php | 2 +- application/modules/dev/forms/FilterAdd.php | 2 +- application/modules/dev/forms/FilterEntriesAdd.php | 2 +- application/modules/dev/forms/FilterEvaluate.php | 2 +- application/modules/dev/forms/GroupAdd.php | 2 +- application/modules/dev/forms/GroupEdit.php | 2 +- application/modules/dev/forms/GroupLink.php | 2 +- application/modules/dev/forms/GroupRequest.php | 2 +- application/modules/dev/forms/PersonEdit.php | 2 +- application/modules/dev/forms/Pool.php | 2 +- application/modules/dev/forms/PoolClient.php | 2 +- application/modules/dev/forms/Session.php | 2 +- .../modules/fbgui/controllers/IndexController.php | 18 ++++++ .../modules/fbgui/views/scripts/index/index.phtml | 43 ++++++++++++++ .../modules/user/controllers/IndexController.php | 18 ++++++ application/modules/user/forms/Login.php | 13 +++++ .../modules/user/views/scripts/index/index.phtml | 46 +++++++++++++++ .../controllers/IndexControllerTest.php | 20 +++++++ 55 files changed, 446 insertions(+), 120 deletions(-) create mode 100644 application/controllers/ErrorController.php create mode 100644 application/controllers/IndexController.php create mode 100644 application/modules/dev/Bootstrap.php create mode 100644 application/modules/fbgui/controllers/IndexController.php create mode 100644 application/modules/fbgui/views/scripts/index/index.phtml create mode 100644 application/modules/user/controllers/IndexController.php create mode 100644 application/modules/user/forms/Login.php create mode 100644 application/modules/user/views/scripts/index/index.phtml create mode 100644 tests/application/controllers/IndexControllerTest.php (limited to 'application/modules/dev/controllers/SessionController.php') diff --git a/.gitignore b/.gitignore index 3184cc6..3dd8945 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ library/ .buildpath .settings/ application/configs/application.ini +resources/ diff --git a/.zfproject.xml b/.zfproject.xml index e0bd2af..fea5232 100644 --- a/.zfproject.xml +++ b/.zfproject.xml @@ -212,7 +212,71 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -472,6 +536,8 @@ + + diff --git a/application/Bootstrap.php b/application/Bootstrap.php index f06c85b..f9ee092 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -2,7 +2,23 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { - + protected function _initAutoloader() + { + $moduleLoader = new Zend_Application_Module_Autoloader + ( + array + ( + 'namespace' => '', + 'basePath' => APPLICATION_PATH, + 'resourceTypes' => array( + 'form' => array( + 'path' => 'forms/', + 'namespace' => 'Form', + ) + ) + ) + ); + } protected function _initAuth(){ $auth = Zend_Auth::getInstance(); $auth->setStorage(new Zend_Auth_Storage_Session('auth')); @@ -26,4 +42,4 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap ->setSeparator(' :: '); } } -include 'Functions.php'; \ No newline at end of file +include 'Functions.php'; diff --git a/application/configs/application.ini.dist b/application/configs/application.ini.dist index b19bac8..9bc14f6 100644 --- a/application/configs/application.ini.dist +++ b/application/configs/application.ini.dist @@ -16,6 +16,7 @@ resources.db.isDefaultTableAdapter = true resources.view[] = "" resources.layout.layoutPath = APPLICATION_PATH "/layouts" resources.layout.layout = "main" +resources.modules = "" [staging : production] diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php new file mode 100644 index 0000000..01ee79b --- /dev/null +++ b/application/controllers/ErrorController.php @@ -0,0 +1,52 @@ +_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'; + print_a($errors); + 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/controllers/IndexController.php b/application/controllers/IndexController.php new file mode 100644 index 0000000..df2f91c --- /dev/null +++ b/application/controllers/IndexController.php @@ -0,0 +1,22 @@ +headScript()."\n";
  • Controller:
      -
    • Person
    • -
    • Group
    • -
    • Role
    • -
    • BootIso
    • -
    • BootMenu
    • -
    • Config
    • -
    • BootOs
    • -
    • Client
    • -
    • Filter
    • -
    • Pool
    • -
    • Session
    • +
    • Person
    • +
    • Group
    • +
    • Role
    • +
    • BootIso
    • +
    • BootMenu
    • +
    • Config
    • +
    • BootOs
    • +
    • Client
    • +
    • Filter
    • +
    • Pool
    • +
    • Session
    • hasIdentity()) {?> -
    • Login
    • -
    • Register
    • +
    • Login
    • +
    • Register
    • -
    • Account Löschen
    • -
    • Logout
    • +
    • Account Löschen
    • +
    • Logout
    • diff --git a/application/modules/dev/Bootstrap.php b/application/modules/dev/Bootstrap.php new file mode 100644 index 0000000..7fc413c --- /dev/null +++ b/application/modules/dev/Bootstrap.php @@ -0,0 +1,5 @@ +isValid($_POST)) { @@ -72,9 +72,9 @@ class AuthController extends Zend_Controller_Action print_a('Already logged in.'); } else { if (!isset($_POST["register"])){ - $registerForm = new Application_Form_AuthRegister(); + $registerForm = new dev_Form_AuthRegister(); } else { - $registerForm = new Application_Form_AuthRegister($_POST); + $registerForm = new dev_Form_AuthRegister($_POST); if ($registerForm->isValid($_POST)) { @@ -116,9 +116,9 @@ class AuthController extends Zend_Controller_Action public function recoverpasswordAction() { if (!isset($_POST["recoverPassword"])){ - $recoverPasswordForm = new Application_Form_AuthRecoverPassword(); + $recoverPasswordForm = new dev_Form_AuthRecoverPassword(); } else { - $recoverPasswordForm = new Application_Form_AuthRecoverPassword($_POST); + $recoverPasswordForm = new dev_Form_AuthRecoverPassword($_POST); # Wiederherstellung funktioniert noch nicht!!! /*if ($recoverPasswordForm->isValid($_POST)) { $recoverPasswordForm->getView()->url(); @@ -166,4 +166,4 @@ class AuthController extends Zend_Controller_Action $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 index 078c962..770271d 100644 --- a/application/modules/dev/controllers/BootisoController.php +++ b/application/modules/dev/controllers/BootisoController.php @@ -1,6 +1,6 @@ $groupmapper->fetchAll())); + $createbootisoForm = new dev_Form_BootisoCreate(array('grouplist' => $groupmapper->fetchAll())); } else { - $createbootisoForm = new Application_Form_BootisoCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); + $createbootisoForm = new dev_Form_BootisoCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); if ($createbootisoForm->isValid($_POST)) { @@ -70,11 +70,11 @@ class BootisoController extends Zend_Controller_Action $bootisomapper = new Application_Model_BootIsoMapper(); $bootisomapper->find($bootisoID, $bootiso); - $editbootisoForm = new Application_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll())); + $editbootisoForm = new dev_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll())); $editbootisoForm->populate($bootiso->toArray()); } }else{ - $editbootisoForm = new Application_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); + $editbootisoForm = new dev_Form_BootisoEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); if ($editbootisoForm->isValid($_POST)) { diff --git a/application/modules/dev/controllers/BootmenuController.php b/application/modules/dev/controllers/BootmenuController.php index 641b547..f47b78c 100644 --- a/application/modules/dev/controllers/BootmenuController.php +++ b/application/modules/dev/controllers/BootmenuController.php @@ -1,6 +1,6 @@ $bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll())); + $addbootmenuentryForm = new dev_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); + $addbootmenuentryForm = new dev_Form_BootmenuEntriesAdd(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()),$_POST); if ($addbootmenuentryForm->isValid($_POST)) { @@ -136,10 +136,10 @@ class BootmenuController extends Zend_Controller_Action $groupmapper = new Application_Model_GroupMapper(); if (!isset($_POST["createbootmenu"])){ - $createbootmenuForm = new Application_Form_BootmenuCreate(array('grouplist' => $groupmapper->fetchAll())); + $createbootmenuForm = new dev_Form_BootmenuCreate(array('grouplist' => $groupmapper->fetchAll())); } else { - $createbootmenuForm = new Application_Form_BootmenuCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); + $createbootmenuForm = new dev_Form_BootmenuCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); if ($createbootmenuForm->isValid($_POST)) { @@ -177,11 +177,11 @@ class BootmenuController extends Zend_Controller_Action $bootmenumapper = new Application_Model_BootMenuMapper(); $bootmenumapper->find($bootmenuID, $bootmenu); - $editbootmenuForm = new Application_Form_BootmenuEdit(array('grouplist' => $groupmapper->fetchAll())); + $editbootmenuForm = new dev_Form_BootmenuEdit(array('grouplist' => $groupmapper->fetchAll())); $editbootmenuForm->populate($bootmenu->toArray()); } }else{ - $editbootmenuForm = new Application_Form_BootmenuEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); + $editbootmenuForm = new dev_Form_BootmenuEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); if ($editbootmenuForm->isValid($_POST)) { @@ -226,7 +226,7 @@ class BootmenuController extends Zend_Controller_Action $bootmenuentrymapper->find($bootmenuentryID, $bootmenuentry); - $editbootmenuentryForm = new Application_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll())); + $editbootmenuentryForm = new dev_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll())); if(!isset($_POST['kcl'])){ $editbootmenuentryForm->populate($bootmenuentry->toArray()); } @@ -237,7 +237,7 @@ class BootmenuController extends Zend_Controller_Action } } }else{ - $editbootmenuentryForm = new Application_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()),$_POST); + $editbootmenuentryForm = new dev_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()),$_POST); if ($editbootmenuentryForm->isValid($_POST)) { diff --git a/application/modules/dev/controllers/BootosController.php b/application/modules/dev/controllers/BootosController.php index 3a7ab90..00c2297 100644 --- a/application/modules/dev/controllers/BootosController.php +++ b/application/modules/dev/controllers/BootosController.php @@ -1,6 +1,6 @@ $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); + try{ + $createbootosForm = new dev_Form_BootosCreate(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); + }catch(Zend_Exception $e){ + print_a($e); + } } else { - $createbootosForm = new Application_Form_BootosCreate(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll()),$_POST); + $createbootosForm = new dev_Form_BootosCreate(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll()),$_POST); if ($createbootosForm->isValid($_POST)) { @@ -88,11 +92,11 @@ class BootosController extends Zend_Controller_Action $bootosmapper = new Application_Model_BootOsMapper(); $bootos = $bootosmapper->find($bootosID); - $editbootosForm = new Application_Form_BootosEdit(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); + $editbootosForm = new dev_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); + $editbootosForm = new dev_Form_BootosEdit(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll()),$_POST); if ($editbootosForm->isValid($_POST)) { diff --git a/application/modules/dev/controllers/ClientController.php b/application/modules/dev/controllers/ClientController.php index affa780..b6bcb7e 100644 --- a/application/modules/dev/controllers/ClientController.php +++ b/application/modules/dev/controllers/ClientController.php @@ -1,6 +1,6 @@ _request->getParam('hh'); if (!isset($_POST["add"])){ - $addclient = new Application_Form_Client(array('buttontext' => 'Create Client')); + $addclient = new dev_Form_Client(array('buttontext' => 'Create Client')); $this->view->addclient = $addclient; } else{ - $addfilterform = new Application_Form_Client(array('buttontext' => 'Create Client'),$_POST); + $addfilterform = new dev_Form_Client(array('buttontext' => 'Create Client'),$_POST); if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) { $client = new Application_Model_Client(); $mac = ($mac!='')?$mac:$_POST['macadress']; @@ -61,12 +61,12 @@ class ClientController extends Zend_Controller_Action $mapper = new Application_Model_ClientMapper(); $mapper->find($clientID,$data); - $editclient = new Application_Form_Client(array('buttontext' => 'Edit Client')); + $editclient = new dev_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); + $editclient = new dev_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')); diff --git a/application/modules/dev/controllers/ConfigController.php b/application/modules/dev/controllers/ConfigController.php index 3eff0cc..5528b28 100644 --- a/application/modules/dev/controllers/ConfigController.php +++ b/application/modules/dev/controllers/ConfigController.php @@ -1,6 +1,6 @@ $groupmapper->fetchAll())); + $createconfigForm = new dev_Form_ConfigCreate(array('grouplist' => $groupmapper->fetchAll())); } else { - $createconfigForm = new Application_Form_ConfigCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); + $createconfigForm = new dev_Form_ConfigCreate(array('grouplist' => $groupmapper->fetchAll()),$_POST); if ($createconfigForm->isValid($_POST)) { @@ -71,11 +71,11 @@ class ConfigController extends Zend_Controller_Action $configmapper = new Application_Model_ConfigMapper(); $config = $configmapper->find($configID); - $editconfigForm = new Application_Form_ConfigEdit(array('grouplist' => $groupmapper->fetchAll())); + $editconfigForm = new dev_Form_ConfigEdit(array('grouplist' => $groupmapper->fetchAll())); $editconfigForm->populate($config->toArray()); } }else{ - $editconfigForm = new Application_Form_ConfigEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); + $editconfigForm = new dev_Form_ConfigEdit(array('grouplist' => $groupmapper->fetchAll()),$_POST); if ($editconfigForm->isValid($_POST)) { diff --git a/application/modules/dev/controllers/ErrorController.php b/application/modules/dev/controllers/ErrorController.php index 5bb2749..189614b 100644 --- a/application/modules/dev/controllers/ErrorController.php +++ b/application/modules/dev/controllers/ErrorController.php @@ -1,6 +1,6 @@ getResponse()->setHttpResponseCode(404); $this->view->message = 'Page not found'; + print_a($errors); break; default: // application error diff --git a/application/modules/dev/controllers/FilterController.php b/application/modules/dev/controllers/FilterController.php index da52c34..e6978ab 100644 --- a/application/modules/dev/controllers/FilterController.php +++ b/application/modules/dev/controllers/FilterController.php @@ -1,6 +1,6 @@ fetchAll(); if (!isset($_POST["add"])){ - $addfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus)); + $addfilterform = new dev_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); + $addfilterform = new dev_Form_FilterAdd(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus),$_POST); if ($addfilterform->isValid($_POST)) { try{ $newfilter = new Application_Model_Filter($_POST); @@ -88,7 +88,7 @@ class FilterController extends Zend_Controller_Action $filtermapper->find($filterID,$filter); $filter2 = $filter->toArray(); - $editfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus)); + $editfilterform = new dev_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus)); $editfilterform->populate($filter2); $this->view->editfilterform = $editfilterform; @@ -96,7 +96,7 @@ class FilterController extends Zend_Controller_Action try{ $filterID = $this->_request->getParam('filterID'); - $editfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus),$_POST); + $editfilterform = new dev_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus),$_POST); //TODO: ACL integrieren $_POST['groupID'] = 1; $_POST['membershipID'] = 1; @@ -122,7 +122,7 @@ class FilterController extends Zend_Controller_Action // TODO: ACL implementieren ob er editieren darf if (!isset($_POST["add"])){ try{ - $editfilterform = new Application_Form_FilterEntriesAdd( + $editfilterform = new dev_Form_FilterEntriesAdd( array( 'buttontext' => 'Add Filterentry', 'filterID' => $this->_request->getParam('filterID'), 'data' => $_POST @@ -133,7 +133,7 @@ class FilterController extends Zend_Controller_Action echo "Error message 2: " . $e->getMessage() . "\n"; } } else{ - $editfilterform = new Application_Form_FilterEntriesAdd(array('buttontext' => 'Add Filterentry'),$_POST); + $editfilterform = new dev_Form_FilterEntriesAdd(array('buttontext' => 'Add Filterentry'),$_POST); if ($editfilterform->isValid($_POST)) { $newfilterenty = new Application_Model_FilterEntries(); $newfilterenty->setFilterID($_POST['filterID']); @@ -176,7 +176,7 @@ class FilterController extends Zend_Controller_Action } $data = $filterentry->toArray(); print_a($data); - $editfilterform = new Application_Form_FilterEntriesAdd( + $editfilterform = new dev_Form_FilterEntriesAdd( array('buttontext' => 'Edit Filterentry', 'data' => $data)); @@ -189,7 +189,7 @@ class FilterController extends Zend_Controller_Action } else{ try{ $filterentriesID = $this->_request->getParam('filterentriesID'); - $editfilterform = new Application_Form_FilterEntriesAdd(array('buttontext' => 'Edit Filterentry'),$_POST); + $editfilterform = new dev_Form_FilterEntriesAdd(array('buttontext' => 'Edit Filterentry'),$_POST); if ($editfilterform->isValid($_POST)) { if($_POST['filterID'] == '') unset($_POST['filterID']); @@ -649,7 +649,7 @@ class FilterController extends Zend_Controller_Action $cm = new Application_Model_ClientMapper(); $clients = $cm->fetchAll(); - $filterevaluate = new Application_Form_FilterEvaluate( + $filterevaluate = new dev_Form_FilterEvaluate( array( 'pools' => $pools, 'bootisos' => $bootisos, 'memberships' => $memberships, diff --git a/application/modules/dev/controllers/GroupController.php b/application/modules/dev/controllers/GroupController.php index fbc7943..45c28d4 100644 --- a/application/modules/dev/controllers/GroupController.php +++ b/application/modules/dev/controllers/GroupController.php @@ -1,6 +1,6 @@ $this->groupList)); + $addForm = new dev_Form_GroupAdd(array('grouplist' => $this->groupList)); } else { - $addForm = new Application_Form_GroupAdd(array('grouplist' => $this->groupList),$_POST); + $addForm = new dev_Form_GroupAdd(array('grouplist' => $this->groupList),$_POST); if ($addForm->isValid($_POST)) { $group = new Application_Model_Group($_POST); @@ -72,7 +72,7 @@ class GroupController extends Zend_Controller_Action public function editAction() { if(!isset($_POST['groupID'])) { - $addForm = new Application_Form_GroupAdd(array('grouplist' => $this->groupList)); + $addForm = new dev_Form_GroupAdd(array('grouplist' => $this->groupList)); $this->view->addForm = $addForm; return; } @@ -80,9 +80,9 @@ class GroupController extends Zend_Controller_Action $group = $this->groupMapper->find($_POST['groupID']); $_POST['title'] = $group->getTitle(); $_POST['description'] = $group->getDescription(); - $editForm = new Application_Form_GroupEdit(); + $editForm = new dev_Form_GroupEdit(); } else { - $editForm = new Application_Form_GroupEdit($_POST); + $editForm = new dev_Form_GroupEdit($_POST); if ($editForm->isValid($_POST)) { $group = new Application_Model_Group($_POST); try { @@ -140,9 +140,9 @@ class GroupController extends Zend_Controller_Action public function linkAction() { if (!isset($_POST["link"])){ - $linkForm = new Application_Form_GroupLink(array('grouplist' => $this->groupList)); + $linkForm = new dev_Form_GroupLink(array('grouplist' => $this->groupList)); } else { - $linkForm = new Application_Form_GroupLink(array('grouplist' => $this->groupList),$_POST); + $linkForm = new dev_Form_GroupLink(array('grouplist' => $this->groupList),$_POST); if ($linkForm->isValid($_POST)) { $groupgroups = new Application_Model_GroupGroups(); diff --git a/application/modules/dev/controllers/IndexController.php b/application/modules/dev/controllers/IndexController.php index df2f91c..4c9385c 100644 --- a/application/modules/dev/controllers/IndexController.php +++ b/application/modules/dev/controllers/IndexController.php @@ -1,6 +1,6 @@ view->person = $this->person; if (!isset($_POST["save"])){ - $editForm = new Application_Form_PersonEdit(); + $editForm = new dev_Form_PersonEdit(); } else { - $editForm = new Application_Form_PersonEdit($_POST); + $editForm = new dev_Form_PersonEdit($_POST); if ($editForm->isValid($_POST)) { if(isset($_POST['newpassword'])) { $date = new DateTime(); @@ -94,9 +94,9 @@ class PersonController extends Zend_Controller_Action if(count($allgroups) <= 0) { echo "No Groups to choose."; } - $requestForm = new Application_Form_GroupRequest(array('grouplist' => $allgroups)); + $requestForm = new dev_Form_GroupRequest(array('grouplist' => $allgroups)); } else { - $requestForm = new Application_Form_GroupRequest(array('grouplist' => $allgroups), $_POST); + $requestForm = new dev_Form_GroupRequest(array('grouplist' => $allgroups), $_POST); if ($requestForm->isValid($_POST)) { $groupRequestMapper = new Application_Model_GroupRequestMapper(); $groupRequest = new Application_Model_GroupRequest(); diff --git a/application/modules/dev/controllers/PoolController.php b/application/modules/dev/controllers/PoolController.php index f27ee45..cf6395d 100644 --- a/application/modules/dev/controllers/PoolController.php +++ b/application/modules/dev/controllers/PoolController.php @@ -1,6 +1,6 @@ 'Create Pool')); + $addfilterform = new dev_Form_Pool(array('buttontext' => 'Create Pool')); $this->view->addpool = $addfilterform; }else { - $addpoolform = new Application_Form_Pool(array('buttontext' => 'Create Pool'),$_POST); + $addpoolform = new dev_Form_Pool(array('buttontext' => 'Create Pool'),$_POST); if ($addpoolform->isValid($_POST)) { try{ $pool = new Application_Model_Pool($_POST); @@ -75,12 +75,12 @@ class PoolController extends Zend_Controller_Action $poolmapper->find($poolID,$pool); $poolArray = $pool->toArray(); - $editpool = new Application_Form_Pool(array('buttontext' => 'Edit Pool')); + $editpool = new dev_Form_Pool(array('buttontext' => 'Edit Pool')); $editpool->populate($poolArray); $this->view->editpoolform = $editpool; }else { - $editpoolform = new Application_Form_Pool(array('buttontext' => 'Edit Pool'),$_POST); + $editpoolform = new dev_Form_Pool(array('buttontext' => 'Edit Pool'),$_POST); if ($editpoolform->isValid($_POST)) { try{ $pool = new Application_Model_Pool($_POST); @@ -113,10 +113,10 @@ class PoolController extends Zend_Controller_Action } $freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray); - $poolclient = new Application_Form_PoolClient(array('buttontext' => 'Link Client','clients'=> $freeclients)); + $poolclient = new dev_Form_PoolClient(array('buttontext' => 'Link Client','clients'=> $freeclients)); $this->view->poolclient = $poolclient; }else { - $poolclient = new Application_Form_PoolClient(array('buttontext' => 'Link Client'),$_POST); + $poolclient = new dev_Form_PoolClient(array('buttontext' => 'Link Client'),$_POST); try{ $pool = new Application_Model_PoolEntries($_POST); $pool->setPoolID($this->_request->getParam('poolID')); diff --git a/application/modules/dev/controllers/ResourceController.php b/application/modules/dev/controllers/ResourceController.php index aef8649..c292228 100644 --- a/application/modules/dev/controllers/ResourceController.php +++ b/application/modules/dev/controllers/ResourceController.php @@ -1,6 +1,6 @@ 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships)); + $createsession = new dev_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); + $createsession = new dev_Form_Session(array('buttontext' => 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); #print_a($_POST); if ($createsession->isValid($_POST)) { try{ @@ -115,7 +115,7 @@ class SessionController extends Zend_Controller_Action $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 = new dev_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) { @@ -126,7 +126,7 @@ class SessionController extends Zend_Controller_Action 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); + $editsession = new dev_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); diff --git a/application/modules/dev/forms/AuthDelete.php b/application/modules/dev/forms/AuthDelete.php index 4e9c92d..3429ae0 100644 --- a/application/modules/dev/forms/AuthDelete.php +++ b/application/modules/dev/forms/AuthDelete.php @@ -1,6 +1,6 @@ + a:link, + a:visited + { + color: #0398CA; + } + + span#zf-name + { + color: #91BE3F; + } + + div#welcome + { + color: #FFFFFF; + background-image: url(http://framework.zend.com/images/bkg_header.jpg); + width: 600px; + height: 400px; + border: 2px solid #444444; + overflow: hidden; + text-align: center; + } + + div#more-information + { + background-image: url(http://framework.zend.com/images/bkg_body-bottom.gif); + height: 100%; + } + +
      +

      Welcome to the Zend Framework!

      + +

      This is your project's main page

      + +
      +

      +

      + Helpful Links:
      + Zend Framework Website | + Zend Framework Manual +

      +
      +
      \ No newline at end of file diff --git a/application/modules/user/controllers/IndexController.php b/application/modules/user/controllers/IndexController.php new file mode 100644 index 0000000..934b9ba --- /dev/null +++ b/application/modules/user/controllers/IndexController.php @@ -0,0 +1,18 @@ +view->loginform = new user_Form_Login(); + } + + +} + diff --git a/application/modules/user/forms/Login.php b/application/modules/user/forms/Login.php new file mode 100644 index 0000000..58c5cc9 --- /dev/null +++ b/application/modules/user/forms/Login.php @@ -0,0 +1,13 @@ +loginform; +?> + +
      +

      Welcome to the Zend Framework!

      + +

      This is your project's main page

      + +
      +

      +

      + Helpful Links:
      + Zend Framework Website | + Zend Framework Manual +

      +
      +
      diff --git a/tests/application/controllers/IndexControllerTest.php b/tests/application/controllers/IndexControllerTest.php new file mode 100644 index 0000000..1b4f230 --- /dev/null +++ b/tests/application/controllers/IndexControllerTest.php @@ -0,0 +1,20 @@ +setLogindate($date->getTimestamp()); $this->personmapper->save($person); - $this->_redirect('/'); + $this->_redirect('/dev/'); return; } else { echo "Wrong Email or Password."; @@ -96,7 +96,7 @@ class dev_AuthController extends Zend_Controller_Action return; } echo "Successfully registered.
      "; - echo "Continue to Login: Login"; + echo "Continue to Login: Login"; $this->_helper->redirector('login', 'auth'); return; } diff --git a/application/modules/dev/controllers/BootisoController.php b/application/modules/dev/controllers/BootisoController.php index 770271d..2b0e624 100644 --- a/application/modules/dev/controllers/BootisoController.php +++ b/application/modules/dev/controllers/BootisoController.php @@ -49,7 +49,7 @@ class dev_BootisoController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/bootiso'); + $this->_redirect('/dev/bootiso'); } } @@ -64,7 +64,7 @@ class dev_BootisoController extends Zend_Controller_Action if (!isset($_POST["editbootiso"])){ $bootisoID = $this->_request->getParam('bootisoID'); if (!isset($bootisoID) || !is_numeric($bootisoID)){ - $this->_redirect('/bootiso'); + $this->_redirect('/dev/bootiso'); } else { $bootiso = new Application_Model_BootIso(); $bootisomapper = new Application_Model_BootIsoMapper(); @@ -92,7 +92,7 @@ class dev_BootisoController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/bootiso'); + $this->_redirect('/dev/bootiso'); } } @@ -104,14 +104,14 @@ class dev_BootisoController extends Zend_Controller_Action { $bootisoID = $this->_request->getParam('bootisoID'); if (!isset($bootisoID)){ - $this->_redirect('/bootiso'); + $this->_redirect('/dev/bootiso'); } else { $bootiso = new Application_Model_BootIso(); $bootiso->setID($bootisoID); $bootisomapper = new Application_Model_BootIsoMapper(); $bootisomapper->delete($bootiso); } - $this->_redirect('/bootiso'); + $this->_redirect('/dev/bootiso'); } diff --git a/application/modules/dev/controllers/BootmenuController.php b/application/modules/dev/controllers/BootmenuController.php index f47b78c..07924d4 100644 --- a/application/modules/dev/controllers/BootmenuController.php +++ b/application/modules/dev/controllers/BootmenuController.php @@ -123,7 +123,7 @@ class dev_BootmenuController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/bootmenu'); + $this->_redirect('/dev/bootmenu'); } } @@ -156,7 +156,7 @@ class dev_BootmenuController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/bootmenu'); + $this->_redirect('/dev/bootmenu'); } } @@ -201,7 +201,7 @@ class dev_BootmenuController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/bootmenu'); + $this->_redirect('/dev/bootmenu'); } } @@ -221,7 +221,7 @@ class dev_BootmenuController extends Zend_Controller_Action if (!isset($_POST["editbootmenuentry"])){ $bootmenuentryID = $this->_request->getParam('bootmenuentryID'); if (!isset($bootmenuentryID) || !is_numeric($bootmenuentryID)){ - $this->_redirect('/bootmenu'); + $this->_redirect('/dev/bootmenu'); } else { $bootmenuentrymapper->find($bootmenuentryID, $bootmenuentry); @@ -262,7 +262,7 @@ class dev_BootmenuController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/bootmenu'); + $this->_redirect('/dev/bootmenu'); } } @@ -283,21 +283,21 @@ class dev_BootmenuController extends Zend_Controller_Action $bootmenuentrymapper->delete($bootmenuentry); $bootmenuentrymapper->orderremove($bootmenuentry); } - $this->_redirect('/bootmenu'); + $this->_redirect('/dev/bootmenu'); } public function deletebootmenuAction() { $bootmenuID = $this->_request->getParam('bootmenuID'); if (!isset($bootmenuID) || !is_numeric($bootmenuID)){ - $this->_redirect('/bootmenu'); + $this->_redirect('/dev/bootmenu'); } else { $bootmenu = new Application_Model_BootMenu(); $bootmenu->setID($bootmenuID); $bootmenumapper = new Application_Model_BootMenuMapper(); $bootmenumapper->delete($bootmenu); } - $this->_redirect('/bootmenu'); + $this->_redirect('/dev/bootmenu'); } private function arrayDiff($a, $b){ diff --git a/application/modules/dev/controllers/BootosController.php b/application/modules/dev/controllers/BootosController.php index 00c2297..36c1cf5 100644 --- a/application/modules/dev/controllers/BootosController.php +++ b/application/modules/dev/controllers/BootosController.php @@ -70,7 +70,7 @@ class dev_BootosController extends Zend_Controller_Action } - $this->_redirect('/bootos'); + $this->_redirect('/dev/bootos'); } } @@ -86,7 +86,7 @@ class dev_BootosController extends Zend_Controller_Action if (!isset($_POST["editbootos"])){ $bootosID = $this->_request->getParam('bootosID'); if (!isset($bootosID) || !is_numeric($bootosID)){ - $this->_redirect('/bootos'); + $this->_redirect('/dev/bootos'); } else { $bootos = new Application_Model_BootOs(); $bootosmapper = new Application_Model_BootOsMapper(); @@ -116,7 +116,7 @@ class dev_BootosController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/bootos'); + $this->_redirect('/dev/bootos'); } } @@ -129,14 +129,14 @@ class dev_BootosController extends Zend_Controller_Action { $bootosID = $this->_request->getParam('bootosID'); if (!isset($bootosID)){ - $this->_redirect('/bootos'); + $this->_redirect('/dev/bootos'); } else { $bootos = new Application_Model_BootOs(); $bootos->setID($bootosID); $bootosmapper = new Application_Model_BootOsMapper(); $bootosmapper->delete($bootos); } - $this->_redirect('/bootos'); + $this->_redirect('/dev/bootos'); } diff --git a/application/modules/dev/controllers/ClientController.php b/application/modules/dev/controllers/ClientController.php index b6bcb7e..d73379c 100644 --- a/application/modules/dev/controllers/ClientController.php +++ b/application/modules/dev/controllers/ClientController.php @@ -34,7 +34,7 @@ class dev_ClientController extends Zend_Controller_Action $clientmapper = new Application_Model_ClientMapper(); $clientmapper->save($client); print_a('inserted'); - $this->_redirect('/client'); + $this->_redirect('/dev/client'); } $this->view->addclient = $addclient; } @@ -50,7 +50,7 @@ class dev_ClientController extends Zend_Controller_Action $clientMapper = new Application_Model_ClientMapper(); $clientMapper->delete($removeClient); } - $this->_redirect('/client'); + $this->_redirect('/dev/client'); } public function editclientAction() @@ -73,7 +73,7 @@ class dev_ClientController extends Zend_Controller_Action $clientmapper = new Application_Model_ClientMapper(); $clientmapper->save($client); print_a('updated'); - $this->_redirect('/client'); + $this->_redirect('/dev/client'); } $this->view->editclient = $editclient; } diff --git a/application/modules/dev/controllers/ConfigController.php b/application/modules/dev/controllers/ConfigController.php index 5528b28..47b9eeb 100644 --- a/application/modules/dev/controllers/ConfigController.php +++ b/application/modules/dev/controllers/ConfigController.php @@ -50,7 +50,7 @@ class dev_ConfigController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/config'); + $this->_redirect('/dev/config'); } } @@ -65,7 +65,7 @@ class dev_ConfigController extends Zend_Controller_Action if (!isset($_POST["editconfig"])){ $configID = $this->_request->getParam('configID'); if (!isset($configID) || !is_numeric($configID)){ - $this->_redirect('/config'); + $this->_redirect('/dev/config'); } else { $config = new Application_Model_Config(); $configmapper = new Application_Model_ConfigMapper(); @@ -93,7 +93,7 @@ class dev_ConfigController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "
      "; } - $this->_redirect('/config'); + $this->_redirect('/dev/config'); } } @@ -105,14 +105,14 @@ class dev_ConfigController extends Zend_Controller_Action { $configID = $this->_request->getParam('configID'); if (!isset($configID)){ - $this->_redirect('/config'); + $this->_redirect('/dev/config'); } else { $config = new Application_Model_Config(); $config->setID($configID); $configmapper = new Application_Model_ConfigMapper(); $configmapper->delete($config); } - $this->_redirect('/config'); + $this->_redirect('/dev/config'); } diff --git a/application/modules/dev/controllers/FilterController.php b/application/modules/dev/controllers/FilterController.php index e6978ab..b346810 100644 --- a/application/modules/dev/controllers/FilterController.php +++ b/application/modules/dev/controllers/FilterController.php @@ -50,7 +50,7 @@ class dev_FilterController extends Zend_Controller_Action $newfilter2 = new Application_Model_FilterMapper(); $newfilter2->save($newfilter); - $this->_redirect('/filter'); + $this->_redirect('/dev/filter'); return; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; @@ -70,7 +70,7 @@ class dev_FilterController extends Zend_Controller_Action $filtermapper = new Application_Model_FilterMapper(); $filtermapper->delete($deletefilter); } - $this->_redirect('/filter'); + $this->_redirect('/dev/filter'); } public function editfilterAction() @@ -108,7 +108,7 @@ class dev_FilterController extends Zend_Controller_Action $newfilter2 = new Application_Model_FilterMapper(); $newfilter2->save($newfilterenty); echo 'valid'; - $this->_redirect('/filter'); + $this->_redirect('/dev/filter'); } $this->view->editfilterform = $editfilterform; }catch (Zend_Exception $e) { @@ -151,7 +151,7 @@ class dev_FilterController extends Zend_Controller_Action $newfilter2 = new Application_Model_FilterEntriesMapper(); $newfilter2->save($newfilterenty); #print_a($newfilterenty); - $this->_redirect('/filter'); + $this->_redirect('/dev/filter'); } $this->view->editfilterform = $editfilterform; } @@ -206,7 +206,7 @@ class dev_FilterController extends Zend_Controller_Action $newfilter2 = new Application_Model_FilterEntriesMapper(); $newfilter2->save($newfilterenty); #print_a($newfilterenty); - $this->_redirect('/filter'); + $this->_redirect('/dev/filter'); } $this->view->editfilterform = $editfilterform; @@ -224,16 +224,13 @@ class dev_FilterController extends Zend_Controller_Action // 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 "
      "; + $deletefilterentry->setID($filterentriesID); $filterentriesmapper = new Application_Model_FilterEntriesMapper(); $filterentriesmapper->delete($deletefilterentry); echo "ok"; } - $this->_redirect('/filter'); + $this->_redirect('/dev/filter'); }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } diff --git a/application/modules/dev/controllers/GroupController.php b/application/modules/dev/controllers/GroupController.php index 45c28d4..0456665 100644 --- a/application/modules/dev/controllers/GroupController.php +++ b/application/modules/dev/controllers/GroupController.php @@ -21,7 +21,7 @@ class dev_GroupController extends Zend_Controller_Action $this->rolemapper = new Application_Model_RoleMapper(); $this->groupList = $this->groupMapper->fetchAll(); } else { - $this->_helper->redirector('login', 'auth'); + $this->_helper->redirector('dev', 'login', 'auth'); } } diff --git a/application/modules/dev/controllers/PersonController.php b/application/modules/dev/controllers/PersonController.php index 3cb1756..74c58c7 100644 --- a/application/modules/dev/controllers/PersonController.php +++ b/application/modules/dev/controllers/PersonController.php @@ -30,13 +30,13 @@ class dev_PersonController extends Zend_Controller_Action } } } else { - $this->_helper->redirector('login', 'auth'); + $this->_helper->redirector('dev','login', 'auth'); } } public function indexAction() { - $this->_helper->redirector('show', 'person'); + $this->_helper->redirector('dev','show', 'person'); } public function showAction() diff --git a/application/modules/dev/controllers/PoolController.php b/application/modules/dev/controllers/PoolController.php index cf6395d..375f709 100644 --- a/application/modules/dev/controllers/PoolController.php +++ b/application/modules/dev/controllers/PoolController.php @@ -42,7 +42,7 @@ class dev_PoolController extends Zend_Controller_Action $pool = new Application_Model_Pool($_POST); $poolmapper = new Application_Model_PoolMapper(); $poolmapper->save($pool); - $this->_redirect('/pool'); + $this->_redirect('/dev/pool'); return; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; @@ -62,7 +62,7 @@ class dev_PoolController extends Zend_Controller_Action $poolmapper = new Application_Model_PoolMapper(); $poolmapper->delete($deletepool); } - $this->_redirect('/pool'); + $this->_redirect('/dev/pool'); } public function editpoolAction() @@ -87,7 +87,7 @@ class dev_PoolController extends Zend_Controller_Action $pool->setID($this->_request->getParam('poolID')); $poolmapper = new Application_Model_PoolMapper(); $poolmapper->save($pool); - $this->_redirect('/pool'); + $this->_redirect('/dev/pool'); }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } @@ -125,7 +125,7 @@ class dev_PoolController extends Zend_Controller_Action } $poolmapper = new Application_Model_PoolEntriesMapper(); $poolmapper->save($pool); - $this->_redirect('/pool'); + $this->_redirect('/dev/pool'); }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } @@ -158,7 +158,7 @@ class dev_PoolController extends Zend_Controller_Action $deletepoolentriesmapper->delete($deletepoolentries); echo "ok"; } - $this->_redirect('/pool'); + $this->_redirect('/dev/pool'); } diff --git a/application/modules/dev/controllers/RoleController.php b/application/modules/dev/controllers/RoleController.php index 195accc..2f2de2d 100644 --- a/application/modules/dev/controllers/RoleController.php +++ b/application/modules/dev/controllers/RoleController.php @@ -8,7 +8,7 @@ class dev_RoleController extends Zend_Controller_Action if (Zend_Auth::getInstance()->hasIdentity()) { } else { - $this->_helper->redirector('login', 'auth'); + $this->_helper->redirector('dev', 'login', 'auth'); } } diff --git a/application/modules/dev/controllers/SessionController.php b/application/modules/dev/controllers/SessionController.php index e7092bc..bb92da9 100644 --- a/application/modules/dev/controllers/SessionController.php +++ b/application/modules/dev/controllers/SessionController.php @@ -76,7 +76,7 @@ class dev_SessionController extends Zend_Controller_Action $sessionmapper = new Application_Model_SessionMapper(); $sessionmapper->save($session); - $this->_redirect('/session'); + $this->_redirect('/dev/session'); }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; @@ -155,7 +155,7 @@ class dev_SessionController extends Zend_Controller_Action }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } - $this->_redirect('/session'); + $this->_redirect('/dev/session'); } } @@ -168,7 +168,7 @@ class dev_SessionController extends Zend_Controller_Action $sessionmapper = new Application_Model_SessionMapper(); $sessionmapper->delete($deletesession); } - $this->_redirect('/session'); + $this->_redirect('/dev/session'); } diff --git a/application/modules/dev/views/scripts/auth/login.phtml b/application/modules/dev/views/scripts/auth/login.phtml index 4e642a3..815cda4 100644 --- a/application/modules/dev/views/scripts/auth/login.phtml +++ b/application/modules/dev/views/scripts/auth/login.phtml @@ -2,4 +2,4 @@ $this->loginForm->setAction($this->url()); echo $this->loginForm; ?> -
      \ No newline at end of file +
      diff --git a/application/modules/dev/views/scripts/bootiso/index.phtml b/application/modules/dev/views/scripts/bootiso/index.phtml index 5e7da1e..b119aff 100644 --- a/application/modules/dev/views/scripts/bootiso/index.phtml +++ b/application/modules/dev/views/scripts/bootiso/index.phtml @@ -1,6 +1,6 @@

      BootISO

      formButton('createbootiso', 'Create BootISO', array( - 'onclick' => 'self.location="/bootiso/createbootiso"', + 'onclick' => 'self.location="/dev/bootiso/createbootiso"', 'class' => 'addbutton'))?> @@ -30,6 +30,7 @@
      escape($bootiso->getPublic()); ?> Edit BootISO 'self.location="/dev/bootmenu/createbootmenu"', 'class' => 'addbutton'))?> @@ -24,6 +24,7 @@ escape(date('Y-m-d H:i:s', $bootmenu->getCreated())); ?> Edit Bootmenu Delete Bootmenu url( array( + 'module' => 'dev', 'controller' => 'bootmenu', 'action' => 'editbootmenuentry', 'bootmenuentryID' => $bootmenuentry->getID(), @@ -96,6 +100,7 @@ true, false) ?>">Edit Entry 'self.location="/dev/bootos/createbootos"', 'class' => 'addbutton'))?> @@ -37,6 +37,7 @@
      escape($bootos->getPublic()); ?> Edit BootOS 'self.location="/dev/client/addclient"', 'class' => 'addbutton'))?> clients): ?> @@ -18,6 +18,7 @@ escape($client->getHardwarehash()) ?> Edit Client 'self.location="/dev/config/createconfig"', 'class' => 'addbutton'))?> @@ -25,6 +25,7 @@
      escape(date('Y-m-d H:i:s', $config->getCreated())); ?> Edit Config 'self.location="/dev/filter/addfilter"', 'class' => 'addbutton'))?> filters): ?> @@ -22,6 +22,7 @@ escape($filter->bootmenuID) ?> Edit Filter Delete Filter url( array( + 'module' => 'dev', 'controller' => 'filter', 'action' => 'editfilterentry', 'filterentriesID' => $filterentry['filterentriesID'] @@ -90,6 +94,7 @@ true) ?>">Edit Filterentry 'self.location="/dev/filter/testevaluate"', 'class' => 'addbutton'))?> diff --git a/application/modules/dev/views/scripts/group/index.phtml b/application/modules/dev/views/scripts/group/index.phtml index b8178dc..d1faf04 100644 --- a/application/modules/dev/views/scripts/group/index.phtml +++ b/application/modules/dev/views/scripts/group/index.phtml @@ -31,5 +31,5 @@

      - +
      diff --git a/application/modules/dev/views/scripts/person/show.phtml b/application/modules/dev/views/scripts/person/show.phtml index 5386c06..945bb61 100644 --- a/application/modules/dev/views/scripts/person/show.phtml +++ b/application/modules/dev/views/scripts/person/show.phtml @@ -1,5 +1,5 @@
      - +
      @@ -61,7 +61,7 @@ foreach($this->groups as $group) {
      Remove Membership
      @@ -74,6 +74,6 @@ foreach($this->groups as $group) {

      -
      diff --git a/application/modules/dev/views/scripts/pool/index.phtml b/application/modules/dev/views/scripts/pool/index.phtml index 2c6ba16..06764d0 100644 --- a/application/modules/dev/views/scripts/pool/index.phtml +++ b/application/modules/dev/views/scripts/pool/index.phtml @@ -1,6 +1,6 @@

      Pools

      formButton('createconfig', 'Create Pool', array( - 'onclick' => 'self.location="/pool/createpool"', + 'onclick' => 'self.location="/dev/pool/createpool"', 'class' => 'addbutton'))?> pools): ?> @@ -20,6 +20,7 @@
      escape($pool->getLocation()) ?> Edit Pool Delete Pool url( array( + 'module' => 'dev', 'controller' => 'pool', 'action' => 'unlinkclient', 'poolentriesID' => $client['poolentriesID'] @@ -104,6 +108,7 @@ foreach ($this->freeclients as $client): ?> pools as $pool): ?>