summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/PrebootController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/modules/user/controllers/PrebootController.php')
-rw-r--r--application/modules/user/controllers/PrebootController.php43
1 files changed, 19 insertions, 24 deletions
diff --git a/application/modules/user/controllers/PrebootController.php b/application/modules/user/controllers/PrebootController.php
index 43cbf8a..f283969 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));
@@ -69,11 +69,11 @@ class User_PrebootController extends Zend_Controller_Action
$mySearch = new Pbs_Search();
$mySearch->setSearchTerm($search);
$mySearch->setModule('preboot');
- $this->view->searchform = $mySearch->searchForm();
if($search != ''){
$this->view->search = $mySearch->getSearchTerm();
$this->view->prebootlist = $mySearch->search($this->view->prebootlist);
}
+ $this->view->searchform = $mySearch->searchForm();
// Pagination
$pagination = new Pbs_Pagination();
@@ -87,8 +87,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');
@@ -107,8 +106,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"])){
@@ -124,8 +123,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 {
@@ -168,8 +166,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();
@@ -199,8 +197,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');
@@ -258,8 +256,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');
@@ -277,16 +275,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)) {
@@ -294,7 +290,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);
@@ -302,8 +297,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);
@@ -365,8 +360,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{