diff options
Diffstat (limited to 'application/modules')
| -rw-r--r-- | application/modules/fbgui/controllers/IndexController.php | 2 | ||||
| -rw-r--r-- | application/modules/user/controllers/BootosController.php | 76 |
2 files changed, 64 insertions, 14 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index c70386f..505c68b 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -26,7 +26,7 @@ class Fbgui_IndexController extends Zend_Controller_Action $groupID = $bootiso->getGroupID(); } elseif(isset($_POST['serialnumber'])){ - $results = $bootisomapper->findBy('serialnumber',$_POST['serialnumber']); + $results = $bootisomapper->findBy('serialnumber',$_POST['serialnumber'],true); if(count($results) == 0){ echo 'Your serialnumber is not known by the system'; } diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php index 81ddda3..8daa96c 100644 --- a/application/modules/user/controllers/BootosController.php +++ b/application/modules/user/controllers/BootosController.php @@ -3,30 +3,75 @@ class user_BootosController extends Zend_Controller_Action { + protected $bootosMapper; + protected $membershipMapper; + protected $membership; + public function init() { - $db = Zend_Db_Table::getDefaultAdapter(); + if (Zend_Auth::getInstance()->hasIdentity()) { + $userIDsNamespace = Zend_Session::namespaceGet('userIDs'); + if($userIDsNamespace['membershipID'] ==''){ + $this->_redirect('/user/index'); + } + + $this->bootosMapper = new Application_Model_BootOsMapper(); + + $this->membershipMapper = new Application_Model_MembershipMapper(); + $this->membership = new Application_Model_Membership(); + $this->membershipMapper->find($userIDsNamespace['membershipID'],$this->membership); + + $this->db = Zend_Db_Table::getDefaultAdapter(); + } else { + $this->_helper->redirector('login', 'auth'); + } } public function indexAction() { + $result = $this->_request->getParam('addresult'); + if($result != ""){ + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('create',$result); + } + $result = $this->_request->getParam('deleteresult'); + if($result != ""){ + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('delete',$result); + } + $result = $this->_request->getParam('modifyresult'); + if($result != ""){ + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('modify',$result); + } + $result = $this->_request->getParam('updateresult'); + if($result != ""){ + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('update',$result); + } - $bootosmapper = new Application_Model_BootOsMapper(); + $groupMapper = new Application_Model_GroupMapper(); + $personMapper = new Application_Model_PersonMapper(); - $groupmapper = new Application_Model_GroupMapper(); - $membershipmapper = new Application_Model_MembershipMapper(); - $personmapper = new Application_Model_PersonMapper(); - $configmapper = new Application_Model_ConfigMapper(); + $groupID = $this->membership->getGroupID(); + + //TODO ACL Darf er BootOsMenu sehen? + if(false) + $this->_redirect('/user/index'); + + $configMapper = new Application_Model_ConfigMapper(); - $this->view->bootoslist = $bootosmapper->fetchAll(); + $this->view->bootoslist = $this->bootosMapper->findBy("groupID", $groupID); $this->view->update = array(); + $update = $this->_request->getParam('checkupdate'); + if(count($this->view->bootoslist)>0){ foreach ($this->view->bootoslist as $bootos){ - $this->view->update[$bootos->getID()] = $this->checkupdateAction($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()); + $this->view->update[$bootos->getID()] = $update && $this->checkupdateAction($bootos); + $bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupMapper->find($bootos->getGroupID())->getTitle()); + $bootos->setMembershipID("[".$bootos->getMembershipID()."] ".$personMapper->find($this->membershipMapper->find($bootos->getMembershipID())->getPersonID())->getFirstname()); + $bootos->setConfigID("[".$bootos->getConfigID()."] ".$configMapper->find($bootos->getConfigID())->getTitle()); } } @@ -35,8 +80,13 @@ class user_BootosController extends Zend_Controller_Action public function createbootosAction() { - $groupmapper = new Application_Model_GroupMapper(); - $configmapper = new Application_Model_ConfigMapper(); + + //TODO ACL Darf er BootISOs erstellen? + if(false) + $this->_redirect('/user/bootiso/index/addresult/forbidden'); + + $groupMapper = new Application_Model_GroupMapper(); + $configMapper = new Application_Model_ConfigMapper(); if (!isset($_POST["createbootos"])){ try{ |
