diff options
| author | michael pereira | 2011-03-30 13:17:49 +0200 |
|---|---|---|
| committer | michael pereira | 2011-03-30 13:17:49 +0200 |
| commit | f1654848b7e19f2ffdc8bd7e295526e1e1106ce8 (patch) | |
| tree | a984c4f7401c83eddb42fc7faa9c50231459c472 /application/modules/user | |
| parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-f1654848b7e19f2ffdc8bd7e295526e1e1106ce8.tar.gz pbs2-f1654848b7e19f2ffdc8bd7e295526e1e1106ce8.tar.xz pbs2-f1654848b7e19f2ffdc8bd7e295526e1e1106ce8.zip | |
findBy Methode angepasst
Diffstat (limited to 'application/modules/user')
| -rw-r--r-- | application/modules/user/controllers/BootosController.php | 76 |
1 files changed, 63 insertions, 13 deletions
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{ |
