summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/ConfigController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/modules/user/controllers/ConfigController.php')
-rw-r--r--application/modules/user/controllers/ConfigController.php50
1 files changed, 28 insertions, 22 deletions
diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php
index 4bc2526..498e890 100644
--- a/application/modules/user/controllers/ConfigController.php
+++ b/application/modules/user/controllers/ConfigController.php
@@ -48,15 +48,14 @@ class user_ConfigController extends Zend_Controller_Action
$groupID = $this->membership->getGroupID();
- //TODO ACL Darf er Configs sehen?
- if(false)
+ //ACL Darf er Configs sehen?
+ if(!Pbs_Acl::checkRight('csai') && !Pbs_Acl::checkRight('csui'))
$this->_redirect('/user/index');
$this->configMapper = new Application_Model_ConfigMapper();
$groupMapper = new Application_Model_GroupMapper();
- if(true){
- //TODO nur Configs von Admins
+ if(Pbs_Acl::checkRight('csai')){
$this->view->configlist = $this->configMapper->findBy(array('groupID' => $this->membership->getGroupID()));
}else{
$this->view->configlist = $this->configMapper->findBy(array('membershipID' => $this->membership->getID()));
@@ -71,11 +70,11 @@ class user_ConfigController extends Zend_Controller_Action
$mySearch = new Pbs_Search();
$mySearch->setSearchTerm($search);
$mySearch->setModule('config');
- $this->view->searchform = $mySearch->searchForm();
if($search != ''){
$this->view->search = $mySearch->getSearchTerm();
$this->view->configlist = $mySearch->search($this->view->configlist);
}
+ $this->view->searchform = $mySearch->searchForm();
// Pagination
$pagination = new Pbs_Pagination();
@@ -97,22 +96,25 @@ class user_ConfigController extends Zend_Controller_Action
public function createconfigAction()
{
- //TODO ACL Darf er Configs erstellen?
- if(false)
+ //ACL Darf er Configs erstellen?
+ if(!Pbs_Acl::checkRight('cc'))
$this->_redirect('/user/config/index/page/'.$this->page.'/addresult/forbidden');
if (!isset($_POST["createconfig"])){
- $configForm = new user_Form_Config(array('action' => 'createconfig','rights' => null,'page'=>$this->page));
+ $configForm = new user_Form_Config(array('action' => 'createconfig','page'=>$this->page));
} else {
- $configForm = new user_Form_Config(array('action' => 'createconfig','rights' => null,'page'=>$this->page),$_POST);
+ $configForm = new user_Form_Config(array('action' => 'createconfig','page'=>$this->page),$_POST);
if ($configForm->isValid($_POST)) {
$config = new Application_Model_Config($_POST);
$config->setCreated(time());
- $config->setMembershipID($this->membership->getID());
- $config->setGroupID($this->membership->getGroupID());
-
+
+ if(Pbs_Acl::checkRight('csai'))
+ $config->setGroupID($this->membership->getGroupID());
+ else
+ $config->setMembershipID($this->membership->getID());
+
try {
$this->configMapper->save($config);
}catch(Zend_Exception $e)
@@ -130,8 +132,8 @@ class user_ConfigController extends Zend_Controller_Action
public function editconfigAction()
{
- //TODO ACL Darf er Configs editieren?
- if(false)
+ //ACL Darf er Configs editieren?
+ if(!Pbs_Acl::checkRight('ce'))
$this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/forbidden');
$configID = $this->_request->getParam('configID');
@@ -153,11 +155,11 @@ class user_ConfigController extends Zend_Controller_Action
if (!isset($_POST["editconfig"])){
- $configForm = new user_Form_Config(array('action' => 'editconfig','rights' => 'meta','page'=>$this->page));
+ $configForm = new user_Form_Config(array('action' => 'editconfig','page'=>$this->page));
$configForm->populate($config->toArray());
}else{
- $configForm = new user_Form_Config(array('action' => 'editconfig','rights' => 'meta','page'=>$this->page),$_POST);
+ $configForm = new user_Form_Config(array('action' => 'editconfig','page'=>$this->page),$_POST);
if ($configForm->isValid($_POST)) {
@@ -165,13 +167,17 @@ class user_ConfigController extends Zend_Controller_Action
$config = new Application_Model_Config($_POST);
$config->setCreated(time());
- $config->setMembershipID($this->membership->getID());
- $config->setGroupID($this->membership->getGroupID());
+
+ if(Pbs_Acl::checkRight('csai'))
+ $config->setGroupID($this->membership->getGroupID());
+ else
+ $config->setMembershipID($this->membership->getID());
+
$config->setID($configID);
if($configold->getShellscript() != $config->getShellscript()){
- //TODO ACL Is he allowed to edit other than Metadata?
- if(false)
+ //ACL Is he allowed to edit other than Metadata?
+ if(Pbs_Acl::checkRight('cem'))
$this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/forbidden');
}
@@ -195,8 +201,8 @@ class user_ConfigController extends Zend_Controller_Action
public function deleteconfigAction()
{
- //TODO ACL Darf er Configs löschen?
- if(false)
+ //ACL Darf er Configs löschen?
+ if(!Pbs_Acl::checkRight('cd'))
$this->_redirect('/user/config/index/page/'.$this->page.'/deleteresult/forbidden');
try{