summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/PrebootController.php
diff options
context:
space:
mode:
authormichael pereira2011-04-05 15:35:32 +0200
committermichael pereira2011-04-05 15:35:32 +0200
commit198221618856ef22ab8f69874b8d4e101db3746d (patch)
tree85ece381624332620219983e037bac94776d5d52 /application/modules/user/controllers/PrebootController.php
parentfind Methode angepasst (diff)
downloadpbs2-198221618856ef22ab8f69874b8d4e101db3746d.tar.gz
pbs2-198221618856ef22ab8f69874b8d4e101db3746d.tar.xz
pbs2-198221618856ef22ab8f69874b8d4e101db3746d.zip
Rechte in Controller eingepflanzt
Diffstat (limited to 'application/modules/user/controllers/PrebootController.php')
-rw-r--r--application/modules/user/controllers/PrebootController.php41
1 files changed, 18 insertions, 23 deletions
diff --git a/application/modules/user/controllers/PrebootController.php b/application/modules/user/controllers/PrebootController.php
index 6944e27..0572c32 100644
--- a/application/modules/user/controllers/PrebootController.php
+++ b/application/modules/user/controllers/PrebootController.php
@@ -58,8 +58,8 @@ class User_PrebootController extends Zend_Controller_Action
$groupID = $this->membership->getGroupID();
- //TODO ACL Darf er PrebootMenu sehen?
- if(false)
+ //ACL Darf er PrebootMenu sehen?
+ if(!Pbs_Acl::checkRight('pro'))
$this->_redirect('/user/index');
$this->view->prebootlist = $this->prebootMapper->findBy(array("groupID" => $groupID));
@@ -76,8 +76,7 @@ class User_PrebootController extends Zend_Controller_Action
$this->view->page = $pagination->getRequestPage();
$this->view->prebootlist= $this->view->prebootlist;
-
-
+
$this->view->update = array();
$update = $this->_request->getParam('checkupdate');
@@ -92,8 +91,8 @@ class User_PrebootController extends Zend_Controller_Action
public function createprebootAction()
{
- //TODO ACL Is he allowed to create Preboots?
- if(false)
+ //ACL Is he allowed to create Preboots?
+ if(!Pbs_Acl::checkRight('prc'))
$this->_redirect('/user/preboot/index/page/'.$this->page.'/addresult/forbidden');
if (!isset($_POST["createpreboot"])){
@@ -109,8 +108,7 @@ class User_PrebootController extends Zend_Controller_Action
if ($prebootForm->isValid($_POST)) {
$preboot = new Application_Model_PreBoot($_POST);
- $preboot->setMembershipID($this->membership->getID());
- $preboot->setGroupID($this->membership->getGroupID());
+ $preboot->setGroupID($this->membership->getGroupID());
try {
@@ -153,8 +151,8 @@ class User_PrebootController extends Zend_Controller_Action
public function checkupdateAction($preboot)
{
- //TODO ACL Is he allowed to update Preboots?
- if(false)
+ //ACL Is he allowed to update Preboots?
+ if(!Pbs_Acl::checkRight('pru'))
$this->_redirect('/user/preboot/index/page/'.$this->page.'/updateresult/forbidden');
$prebootID = $preboot->getID();
@@ -184,8 +182,8 @@ class User_PrebootController extends Zend_Controller_Action
public function updateprebootAction()
{
- //TODO ACL Is he allowed to update Preboots?
- if(false)
+ //ACL Is he allowed to update Preboots?
+ if(!Pbs_Acl::checkRight('pru'))
$this->_redirect('/user/preboot/index/page/'.$this->page.'/updateresult/forbidden');
$prebootID = $this->_request->getParam('prebootID');
@@ -243,8 +241,8 @@ class User_PrebootController extends Zend_Controller_Action
public function editprebootAction()
{
- //TODO ACL Is he allowed to edit Preboots?
- if(false)
+ //ACL Is he allowed to edit Preboots?
+ if(!Pbs_Acl::checkRight('pre'))
$this->_redirect('/user/preboot/index/page/'.$this->page.'/modifyresult/forbidden');
$prebootID = $this->_request->getParam('prebootID');
@@ -262,16 +260,14 @@ class User_PrebootController extends Zend_Controller_Action
if (!isset($_POST["editpreboot"])){
$prebootForm = new user_Form_Preboot(array(
- 'action' => 'editpreboot',
- 'rights' => 'meta',
+ 'action' => 'editpreboot',
'page' => $this->page));
$prebootForm->populate($preboot->toArray());
}else{
$prebootForm = new user_Form_Preboot(array(
- 'action' => 'editpreboot',
- 'rights' => 'meta',
+ 'action' => 'editpreboot',
'page' => $this->page),$_POST);
if ($prebootForm->isValid($_POST)) {
@@ -279,7 +275,6 @@ class User_PrebootController extends Zend_Controller_Action
$prebootold = $preboot;
$preboot = new Application_Model_PreBoot($_POST);
- $preboot->setMembershipID($this->membership->getID());
$preboot->setGroupID($this->membership->getGroupID());
$preboot->setID($prebootID);
@@ -287,8 +282,8 @@ class User_PrebootController extends Zend_Controller_Action
if($preboot->getPath_preboot() != $prebootold->getPath_preboot()){
- //TODO ACL Is he allowed to edit the Preboot Path?
- if(false)
+ //ACL Is he allowed to edit the Preboot Path?
+ if(Pbs_Acl::checkRight('prem'))
$this->_redirect('/user/preboot/index/page/'.$this->page.'/modifyresult/forbidden');
exec("wget -O '".$path_preboot."preboot.zip' ".escapeshellcmd($preboot->getPath_preboot()) ." 2>&1 | grep 'saved'" , $status);
@@ -350,8 +345,8 @@ class User_PrebootController extends Zend_Controller_Action
public function deleteprebootAction()
{
- //TODO ACL Is he allowed to delete Preboots?
- if(false)
+ //ACL Is he allowed to delete Preboots?
+ if(!Pbs_Acl::checkRight('prd'))
$this->_redirect('/user/preboot/index/page/'.$this->page.'/deleteresult/forbidden');
try{