diff options
Diffstat (limited to 'application/modules/user/controllers/RoleController.php')
| -rw-r--r-- | application/modules/user/controllers/RoleController.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php index 009524f..8f4d85c 100644 --- a/application/modules/user/controllers/RoleController.php +++ b/application/modules/user/controllers/RoleController.php @@ -214,7 +214,8 @@ class User_RoleController extends Zend_Controller_Action } } if(!$found) { - $rightlist[] = $right; + $rightCategory = $right->getRightcategoryID(); + $rightlist[$rightCategory][] = $right; } $found = false; } @@ -223,11 +224,22 @@ class User_RoleController extends Zend_Controller_Action $rightlist = $rights; } if(count($rightlist) > 0) { + $rightCategoryMapper = new Application_Model_RightCategoryMapper(); + $rightCategories = $rightCategoryMapper->fetchAll(); + if(count($rightCategories) > 0) { + foreach($rightCategories as $rightCategory) { + $rightcategorieslist[$rightCategory->getID()] = $rightCategory->getTitle(); + } + } if (!isset($_POST["link"])){ - $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID)); + $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'rightcategorieslist' => $rightcategorieslist, 'roleID' => $roleID)); } else { - $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID), $_POST); + $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'rightcategorieslist' => $rightcategorieslist, 'roleID' => $roleID), $_POST); if ($linkForm->isValid($_POST)) { + if(strpos($_POST['rightID'], 'category') !== false) { + $this->_redirect($_SERVER['HTTP_REFERER']); + return; + } $rightroles = new Application_Model_RightRoles(); $rightroles->setRightID($_POST['rightID']); $rightroles->setRoleID($roleID); |
