diff options
| author | michael pereira | 2011-04-13 15:31:33 +0200 |
|---|---|---|
| committer | michael pereira | 2011-04-13 15:31:33 +0200 |
| commit | c8aae2da451be228d8059af6bb6603985fbac212 (patch) | |
| tree | d711c0803bfda886ce07afb001f014f2492b8a11 /application/modules/user/controllers/PersonController.php | |
| parent | User login + homeverzeichnis in config (diff) | |
| parent | Merge branch 'master' of ssh://git.openslx.org/lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-c8aae2da451be228d8059af6bb6603985fbac212.tar.gz pbs2-c8aae2da451be228d8059af6bb6603985fbac212.tar.xz pbs2-c8aae2da451be228d8059af6bb6603985fbac212.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/modules/user/controllers/PersonController.php')
| -rw-r--r-- | application/modules/user/controllers/PersonController.php | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php index bbdf232..25b1f0a 100644 --- a/application/modules/user/controllers/PersonController.php +++ b/application/modules/user/controllers/PersonController.php @@ -63,6 +63,7 @@ class user_PersonController extends Zend_Controller_Action $this->view->showOtherRight = Pbs_Acl::checkRight('psood'); $this->view->editOtherRight = Pbs_Acl::checkRight('peoa'); $this->view->deleteOtherRight = Pbs_Acl::checkRight('pdo'); + $this->view->suspendRight = Pbs_Acl::checkRight('psa'); $this->view->userIDsNamespace = $this->userIDsNamespace; $this->view->personList = $this->personmapper->fetchAll(); @@ -80,7 +81,7 @@ class user_PersonController extends Zend_Controller_Action // Pagination $pagination = new Pbs_Pagination(); - $pagination->setPerPage(5); + $pagination->setPerPage(10); $pagination->setElement($this->view->personList); $pagination->setRequestPage($this->_request->getParam('page')); $pagination->setPageUrl('/user/person/index/'.((isset($this->view->search))?'/search/'.$this->view->search:'')); @@ -111,7 +112,7 @@ class user_PersonController extends Zend_Controller_Action } // Pagination $pagination = new Pbs_Pagination(); - $pagination->setPerPage(3); + $pagination->setPerPage(10); $pagination->setElement($this->groups); $pagination->setRequestPage($this->_request->getParam('page')); $pagination->setPageUrl('/user/person/index' .((isset($this->view->search))?'/search/'.$this->view->search:'')); @@ -123,6 +124,7 @@ class user_PersonController extends Zend_Controller_Action $this->view->groupRequestRight = true; $this->view->editRight = Pbs_Acl::checkRight('peod'); $this->view->leaveRight = Pbs_Acl::checkRight('gl'); + $this->view->suspendRight = Pbs_Acl::checkRight('psa'); $this->view->userIDsNamespace = Zend_Session::namespaceGet('userIDs'); } @@ -375,7 +377,7 @@ class user_PersonController extends Zend_Controller_Action } // Pagination $pagination = new Pbs_Pagination(); - $pagination->setPerPage(2); + $pagination->setPerPage(10); $pagination->setElement($groups); $pagination->setRequestPage($this->_request->getParam('page')); $pagination->setPageUrl('/user/person/show/personID/' . $personID .((isset($this->view->search))?'/search/'.$this->view->search:'')); @@ -386,6 +388,7 @@ class user_PersonController extends Zend_Controller_Action $this->view->personID = $personID; $this->view->editRight = Pbs_Acl::checkRight('peoa'); $this->view->deleteRight = Pbs_Acl::checkRight('pd'); + $this->view->suspendRight = Pbs_Acl::checkRight('psa'); $this->view->userIDsNamespace = Zend_Session::namespaceGet('userIDs'); } else { $this->_helper->redirector('', 'person'); @@ -409,6 +412,52 @@ class user_PersonController extends Zend_Controller_Action return; } + public function suspendAction() + { + if(!Pbs_Acl::checkRight('psa')) { + $this->_redirect('/user'); + } + $this->_helper->viewRenderer->setNoRender(); + $personID = $this->_request->getParam('personID'); + if(isset($personID)) { + $person = $this->personmapper->find($personID); + $person->setSuspended(1); + if(isset($person)) { + try { + $this->personmapper->save($person); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "<br/>"; + echo "Message: " . $e->getMessage() . "<br/>"; + return; + } + $this->_redirect("/user/person/"); + } + } + } + public function resumeAction() + { + if(!Pbs_Acl::checkRight('psa')) { + $this->_redirect('/user'); + } + $this->_helper->viewRenderer->setNoRender(); + $personID = $this->_request->getParam('personID'); + if(isset($personID)) { + $person = $this->personmapper->find($personID); + $person->setSuspended(0); + if(isset($person)) { + try { + $this->personmapper->save($person); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "<br/>"; + echo "Message: " . $e->getMessage() . "<br/>"; + return; + } + $this->_redirect("/user/person/"); + } + } + } } |
