summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/RoleController.php
diff options
context:
space:
mode:
authorBjörn Geiger2011-03-29 16:03:30 +0200
committerBjörn Geiger2011-03-29 16:03:30 +0200
commitee4955f2e2ee60c55b055a1576b05759c63688d4 (patch)
tree8d435486700a78f8aef75572ee89ad551a53d89f /application/modules/user/controllers/RoleController.php
parentMerge branch 'master' of ssh://git.openslx.org/lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-ee4955f2e2ee60c55b055a1576b05759c63688d4.tar.gz
pbs2-ee4955f2e2ee60c55b055a1576b05759c63688d4.tar.xz
pbs2-ee4955f2e2ee60c55b055a1576b05759c63688d4.zip
Bei LinkRight werden nun die RightCategories angezeigt
Diffstat (limited to 'application/modules/user/controllers/RoleController.php')
-rw-r--r--application/modules/user/controllers/RoleController.php18
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);