diff options
Diffstat (limited to 'application/modules/user/controllers/SessionController.php')
| -rw-r--r-- | application/modules/user/controllers/SessionController.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/application/modules/user/controllers/SessionController.php b/application/modules/user/controllers/SessionController.php index 3c3c192..b027f63 100644 --- a/application/modules/user/controllers/SessionController.php +++ b/application/modules/user/controllers/SessionController.php @@ -23,6 +23,9 @@ class User_SessionController extends Zend_Controller_Action public function indexAction() { + if(!Pbs_Acl::checkRight('so')) + $this->_redirect('/user/index'); + $sessionMapper = new Application_Model_SessionMapper(); $bootisoMapper = new Application_Model_BootIsoMapper(); $bootosMapper = new Application_Model_BootOsMapper(); @@ -54,17 +57,22 @@ class User_SessionController extends Zend_Controller_Action $mySessions[] =$session; } } + // Sort after date/id + usort($mySessions, function($func_a, $func_b) { + if($func_a->getID() == $func_b->getID()) return 0; + return ($func_a->getID() < $func_b->getID()) ? -1 : 1; + }); // Search $search = $this->_request->getParam('search'); $mySearch = new Pbs_Search(); $mySearch->setSearchTerm($search); $mySearch->setModule('session'); - $this->view->searchform = $mySearch->searchForm(); if($search != ''){ $this->view->search = $mySearch->getSearchTerm(); $mySessions = $mySearch->search($mySessions); } + $this->view->searchform = $mySearch->searchForm(); // Pagination $pagination = new Pbs_Pagination(); @@ -79,6 +87,8 @@ class User_SessionController extends Zend_Controller_Action $this->view->sessions = $mySessions; } + + public function searchAction(){ $this->_redirect('/user/session/index/search/'.($_GET['search'])); |
