diff --git a/application/modules/auth/controllers/UserAdminController.php b/application/modules/auth/controllers/UserAdminController.php index 9d902deeb6d9d5466600b32615e0639efca4d71a..40b8a4a41da974cefaad4ab824b9ee60a342bbb0 100644 --- a/application/modules/auth/controllers/UserAdminController.php +++ b/application/modules/auth/controllers/UserAdminController.php @@ -2,6 +2,15 @@ class Auth_UserAdminController extends App_Controller_Action { + public function preDispatch() + { + $user = Auth_UserModel::findCurrentUser(); + $roles = Auth_GroupModel::findByUser($user); + if (!in_array(1, $roles->getId())) { + throw new Exception('You must be logged in to view this page.'); + } + } + public function indexAction() { $users = Auth_UserModel::findAll(); diff --git a/application/modules/requests/controllers/ApprovalBodyAdminController.php b/application/modules/requests/controllers/ApprovalBodyAdminController.php index 5597ceaabd6b98c864a7341cbac24392fa6e5fe1..cb5a14f8166f941621a0e8fdfeae64f4e39d2fdc 100644 --- a/application/modules/requests/controllers/ApprovalBodyAdminController.php +++ b/application/modules/requests/controllers/ApprovalBodyAdminController.php @@ -2,6 +2,14 @@ class Requests_ApprovalBodyAdminController extends App_Controller_Action { + public function preDispatch() + { + $user = Auth_UserModel::findCurrentUser(); + $roles = Auth_GroupModel::findByUser($user); + if (!in_array(1, $roles->getId())) { + throw new Exception('You must be logged in to view this page.'); + } + } public function indexAction() { diff --git a/application/modules/requests/controllers/ApprovalChainManagerController.php b/application/modules/requests/controllers/ApprovalChainManagerController.php index 52ee96a60e0dff7dd87b3c18ccab33ba698e2f44..4fe459d8e6046d4999da52d25c905f8f6f295f96 100644 --- a/application/modules/requests/controllers/ApprovalChainManagerController.php +++ b/application/modules/requests/controllers/ApprovalChainManagerController.php @@ -2,6 +2,15 @@ class Requests_ApprovalChainManagerController extends App_Controller_Action { + public function preDispatch() + { + $user = Auth_UserModel::findCurrentUser(); + $roles = Auth_GroupModel::findByUser($user); + if (!in_array(1, $roles->getId())) { + throw new Exception('You must be logged in to view this page.'); + } + } + public function indexAction() { $in = $this->getRequest()->getParams(); diff --git a/application/modules/requests/controllers/RequestTypeAdminController.php b/application/modules/requests/controllers/RequestTypeAdminController.php index af351f17403a934b0f8861482fec1e7418a5d467..deb83410384b71b83d04e16195542457c4433fa8 100644 --- a/application/modules/requests/controllers/RequestTypeAdminController.php +++ b/application/modules/requests/controllers/RequestTypeAdminController.php @@ -1,7 +1,16 @@ <?php -class Requests_RequestTypeAdminController extends App_Controller_Action { - +class Requests_RequestTypeAdminController extends App_Controller_Action +{ + public function preDispatch() + { + $user = Auth_UserModel::findCurrentUser(); + $roles = Auth_GroupModel::findByUser($user); + if (!in_array(1, $roles->getId())) { + throw new Exception('You must be logged in to view this page.'); + } + } + public function indexAction() { $requestTypes = Requests_RequestTypeModel::findAll();