From 5b1a2cb9c5a39390d125c7bc3667bcd6fa75c0d3 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 13 Apr 2011 17:07:44 +0200 Subject: Groups - Rechte & RootNode darf keine Eltern --- .../modules/user/controllers/GroupController.php | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php index e266ad7..b66f368 100644 --- a/application/modules/user/controllers/GroupController.php +++ b/application/modules/user/controllers/GroupController.php @@ -11,6 +11,7 @@ class User_GroupController extends Zend_Controller_Action protected $groupList = null; protected $userIDsNamespace = null; protected $membership; + protected $page; public function init() { @@ -27,7 +28,8 @@ class User_GroupController extends Zend_Controller_Action $userIDsNamespace = Zend_Session::namespaceGet('userIDs'); $this->membership = new Application_Model_Membership(); $this->membershipMapper->find($userIDsNamespace['membershipID'],$this->membership); - + + $this->page = $this->_request->getParam('page'); } else { $this->_helper->redirector('login', 'auth'); return; @@ -39,6 +41,22 @@ class User_GroupController extends Zend_Controller_Action // ACL show overview if(!Pbs_Acl::checkRight('gso')) $this->_redirect('/user'); + + $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('addresult'); + if($result != ""){ + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('create',$result); + } $this->view->groupList = $this->groupList; @@ -284,6 +302,9 @@ class User_GroupController extends Zend_Controller_Action if ($linkForm->isValid($_POST)) { $groupgroups = new Application_Model_GroupGroups(); + if($_POST['superordinatedGroupID'] == $_POST['groupID'] || $_POST['groupID'] == 1) { + $this->_redirect('/user/group/index/page/'.$this->page.'/addresult/forbidden'); + } $groupgroups->setParentID($_POST['superordinatedGroupID']); $groupgroups->setGroupID($_POST['groupID']); try { -- cgit v1.2.3-55-g7522