summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers
diff options
context:
space:
mode:
authorSimon2011-03-29 17:11:13 +0200
committerSimon2011-03-29 17:11:13 +0200
commit9eb4e958e488c0eccf210cdd6781856e02eee24d (patch)
tree00d9a8bc6046070180b6fe7aa7015e0f122fd04d /application/modules/user/controllers
parenton-screen keyboard in fbgui beim login hinzugefügt (diff)
parentAdd Right Form Select mit optgroup (diff)
downloadpbs2-9eb4e958e488c0eccf210cdd6781856e02eee24d.tar.gz
pbs2-9eb4e958e488c0eccf210cdd6781856e02eee24d.tar.xz
pbs2-9eb4e958e488c0eccf210cdd6781856e02eee24d.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/modules/user/controllers')
-rw-r--r--application/modules/user/controllers/PersonController.php14
-rw-r--r--application/modules/user/controllers/RoleController.php36
2 files changed, 34 insertions, 16 deletions
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php
index 3d231f4..62d3b6b 100644
--- a/application/modules/user/controllers/PersonController.php
+++ b/application/modules/user/controllers/PersonController.php
@@ -41,6 +41,10 @@ class user_PersonController extends Zend_Controller_Action
public function indexAction()
{
+
+ if(!Pbs_Acl::checkRight('psod')) {
+ $this->_redirect('/user');
+ }
$this->view->person = $this->person;
$this->view->groups = $this->groups;
$this->view->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
@@ -48,6 +52,9 @@ class user_PersonController extends Zend_Controller_Action
public function editAction()
{
+ if(!Pbs_Acl::checkRight('peod')) {
+ $this->_redirect('/user');
+ }
$this->view->person = $this->person;
if (!isset($_POST["save"])){
$editForm = new user_Form_PersonEdit();
@@ -79,6 +86,9 @@ class user_PersonController extends Zend_Controller_Action
public function requestAction()
{
+ if(!Pbs_Acl::checkRight('grm')) {
+ $this->_redirect('/user');
+ }
$this->view->person = $this->person;
$allgroups = $this->groupMapper->fetchAll();
$groupRequests = $this->groupRequestMapper->findBy('personID', $this->person->getID());
@@ -141,6 +151,10 @@ class user_PersonController extends Zend_Controller_Action
public function leaveAction()
{
+ // Nicht klar welches Recht geprüft werden soll
+ /*if(!Pbs_Acl::checkRight('peod')) {
+ $this->_redirect('/user');
+ }*/
$this->_helper-> viewRenderer-> setNoRender();
$this->view->person = $this->person;
$membershipID = $this->_request->getParam('membershipID');
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php
index 3db425f..d8ed9e6 100644
--- a/application/modules/user/controllers/RoleController.php
+++ b/application/modules/user/controllers/RoleController.php
@@ -131,12 +131,26 @@ class User_RoleController extends Zend_Controller_Action
if(count($rightroles) > 0) {
foreach($rightroles as $rightrole) {
$right = $this->rightMapper->find($rightrole['rightID']);
- $rightsList[] = $right;
+ $rightsList[$right->getRightcategoryID()][] = $right;
}
if(is_array($rightsList)) {
$this->view->rightsList = $rightsList;
}
}
+ $rightCategoryMapper = new Application_Model_RightCategoryMapper();
+ $rightCategories = $rightCategoryMapper->fetchAll();
+ if(count($rightCategories) > 0) {
+ foreach($rightCategories as $rightCategory) {
+ $rightcategorieslist[$rightCategory->getID()] = $rightCategory->getTitle();
+ }
+ $this->view->rightcategorieslist = $rightcategorieslist;
+ }
+ $rights = $this->rightMapper->fetchAll();
+ if(count($rights) == count($rightroles)) {
+ $this->view->rightsAvailable = false;
+ } else {
+ $this->view->rightsAvailable = true;
+ }
$this->view->role = $this->roleMapper->find($roleID);
$this->view->roleID = $roleID;
$this->view->userIDsNamespace = $this->userIDsNamespace;
@@ -206,6 +220,7 @@ class User_RoleController extends Zend_Controller_Action
$rights = $this->rightMapper->fetchAll();
if(count($rightroles) > 0) {
if(count($rights) > 0) {
+ $rightCategoryMapper = new Application_Model_RightCategoryMapper();
foreach($rights as $right) {
foreach($rightroles as $rightrole) {
if($right->getID() == $rightrole['rightID']) {
@@ -214,8 +229,8 @@ class User_RoleController extends Zend_Controller_Action
}
}
if(!$found) {
- $rightCategory = $right->getRightcategoryID();
- $rightlist[$rightCategory][] = $right;
+ $rightCategory = $rightCategoryMapper->find($right->getRightcategoryID());
+ $rightlist[$rightCategory->getTitle()][$right->getID()] = $right->getTitle();
}
$found = false;
}
@@ -224,22 +239,11 @@ 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, 'rightcategorieslist' => $rightcategorieslist, 'roleID' => $roleID));
+ $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID));
} else {
- $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'rightcategorieslist' => $rightcategorieslist, 'roleID' => $roleID), $_POST);
+ $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, '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);