diff options
| author | Björn Geiger | 2011-04-08 13:20:06 +0200 |
|---|---|---|
| committer | Björn Geiger | 2011-04-08 13:20:06 +0200 |
| commit | fb9e5f028899f8205541fe86d7eb9c5e12c4a5ad (patch) | |
| tree | bd1864cd6dcd4668ba9131b04bf6490ef9e803b3 /application/modules/user/controllers/RoleController.php | |
| parent | highlight in Bootmenu gefixt und das default-Bootmenu bekomtm kein Link zum s... (diff) | |
| download | pbs2-fb9e5f028899f8205541fe86d7eb9c5e12c4a5ad.tar.gz pbs2-fb9e5f028899f8205541fe86d7eb9c5e12c4a5ad.tar.xz pbs2-fb9e5f028899f8205541fe86d7eb9c5e12c4a5ad.zip | |
Auch beim hinzufügen von weiteren Rechten nun Checkboxliste
Diffstat (limited to 'application/modules/user/controllers/RoleController.php')
| -rw-r--r-- | application/modules/user/controllers/RoleController.php | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php index 4e0aa52..88e2eeb 100644 --- a/application/modules/user/controllers/RoleController.php +++ b/application/modules/user/controllers/RoleController.php @@ -303,20 +303,24 @@ class User_RoleController extends Zend_Controller_Action } if(count($rightlist) > 0) { if (!isset($_POST["link"])){ - $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID)); + $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist)); } else { - $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID), $_POST); + $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, $_POST)); if ($linkForm->isValid($_POST)) { - $rightroles = new Application_Model_RightRoles(); - $rightroles->setRightID($_POST['rightID']); - $rightroles->setRoleID($roleID); - try { - $this->rightRolesMapper->save($rightroles); - } catch(Zend_Exception $e) - { - echo "Caught exception: " . get_class($e) . "<br/>"; - echo "Message: " . $e->getMessage() . "<br/>"; - return; + foreach($_POST['rights'] as $rightID => $bool) { + if($bool == 1) { + $rightroles = new Application_Model_RightRoles(); + $rightroles->setRightID($rightID); + $rightroles->setRoleID($roleID); + try { + $this->rightRolesMapper->save($rightroles); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "<br/>"; + echo "Message: " . $e->getMessage() . "<br/>"; + return; + } + } } $this->_redirect('/user/role/show/roleID/' . $roleID); return; |
