public function preDispatch() { parent::preDispatch(); if (array_key_exists('role', $this->_aUserInfo) && $this->_aUserInfo['role'] != 'admin') { throw new AM_Controller_Exception_Forbidden('Access denied'); } $this->oBreadCrumb = new AM_View_Helper_Breadcrumbs($this->view, $this->oDb, $this->getUser(), AM_View_Helper_Breadcrumbs::CLIENT, $this->_getAllParams()); }
public function preDispatch() { parent::preDispatch(); if ($this->_aUserInfo['client'] && $this->_aUserInfo['role'] != 'admin') { $this->getRequest()->setParam('cid', $this->_aUserInfo['client']); } $this->oBreadCrumb = new AM_View_Helper_Breadcrumbs($this->view, $this->oDb, $this->getUser(), AM_View_Helper_Breadcrumbs::APP, $this->_getAllParams()); }
public function preDispatch() { parent::preDispatch(); $this->iIssueId = intval($this->_getParam('iid')); if ($this->iIssueId && !AM_Model_Db_Table_Abstract::factory('issue')->checkAccess($this->iIssueId, $this->_aUserInfo)) { throw new AM_Controller_Exception_Forbidden('Access denied'); } $this->oHelperBreadCrumb = new AM_View_Helper_Breadcrumbs($this->view, $this->oDb, $this->getUser(), AM_View_Helper_Breadcrumbs::REV, $this->_getAllParams()); $this->view->issueId = $this->iIssueId; }
public function preDispatch() { parent::preDispatch(); $this->iApplicationId = intval($this->_getParam('aid')); $this->iIssueId = intval($this->_getParam('iid')); if (!empty($this->iIssueId) && empty($this->iApplicationId)) { $oApplication = AM_Model_Db_Table_Abstract::factory('issue')->findOneBy('id', $this->iIssueId)->getApplication(); if (!empty($oApplication)) { $this->iApplicationId = $oApplication->id; } } if ($this->iApplicationId && !AM_Model_Db_Table_Abstract::factory('application')->checkAccess($this->iApplicationId, $this->_aUserInfo)) { throw new AM_Controller_Exception_Forbidden(); } $this->view->appId = $this->iApplicationId; }
public function preDispatch() { parent::preDispatch(); // if ($this->_aUserInfo['client'] && $this->_aUserInfo['role'] != 'admin') { // $this->getRequest()->setParam('cid', $this->_aUserInfo['client']); // } $this->iApplicationId = intval($this->_getParam('aid')); $iSubscriptionId = intval($this->_getParam('sid')); if (empty($this->iApplicationId) && !empty($iSubscriptionId)) { $oSubscription = AM_Model_Db_Table_Abstract::factory('subscription')->findOneBy('id', $iSubscriptionId); if (!empty($oSubscription)) { $this->iApplicationId = $oSubscription->application; } } // $this->oBreadCrumb = new AM_View_Helper_Breadcrumbs($this->view, $this->oDb, $this->getUser(), // AM_View_Helper_Breadcrumbs::APP, $this->_getAllParams()); }
public function preDispatch() { parent::preDispatch(); $this->_iPageId = intval($this->_getParam('page_id')); $this->_iFieldId = intval($this->_getParam('field_id')); $this->_iElementId = intval($this->_getParam('element')); //Checking permission to the page if ($this->_iPageId) { if (!AM_Model_Db_Table_Abstract::factory('page')->checkAccess($this->_iPageId, $this->_aUserInfo)) { $aMessage = array('state' => 1, 'message' => $this->__('Error. Access denied.')); return $this->getHelper('Json')->sendJson($aMessage, false); } } //Checking permission to the element if ($this->_iElementId) { if (!AM_Model_Db_Table_Abstract::factory('element')->checkAccess($this->_iElementId, $this->_aUserInfo)) { $aMessage = array('state' => 1, 'message' => $this->__('Error. Access denied.')); return $this->getHelper('Json')->sendJson($aMessage, false); } } }