setSuModeOff(); } $this->setSuModeOn(); } if ($this->getAuth()->getSuMode()) { $this->setBodyAttrib('class', 'su'); } if (App_Admin_Auth::getInstance()->getData('reportsAccess') !== 'y') { // if we come to subpage of report page ("require-reports-access" => 'y') - show 404 $reportAlias = Qs_SiteMap::findFirst(array('require-reports-access' => 'y'), null, null, 'fullAlias'); $pageAlias = $this->getOption('fullAlias'); if ($reportAlias && $pageAlias > $reportAlias && $reportAlias === substr($pageAlias, 0, strlen($reportAlias))) { $this->display404(); } } } public function setSuModeOn() { $this->getAuth()->setSuMode(); $this->setRedirectMessage('Su Mode Enabled'); $url = Qs_Request::getUrlExclude('su'); Qs_Http::redirect($url); } public function setRedirectMessage($text) { $session = new Qs_Session_Namespace(Qs_Constant::get('CURRENT_PAGE'), true); $session->message = $text; $session->setExpirationHops(1, 'message'); } public function setSuModeOff() { $this->getAuth()->setSuMode(false); $this->setRedirectMessage('Su Mode Disabled'); $url = Qs_Request::getUrlExclude('su'); Qs_Http::redirect($url); } protected function _beforeDisplay() { parent::_beforeDisplay(); $this->_initSTSAuthLink(); $this->_initKeepSession(); return $this; } public function getMenu() { if (null === $this->_content['menu']) { $this->_content['menu'] = Qs_SiteMap::getBackendMenu(); } if (App_Admin_Auth::getInstance()->getData('reportsAccess') !== 'y') { $this->_content['menu'] = Qs_SiteMap::filterExclude( $this->_content['menu'], array('require-reports-access' => 'y') ); } return $this->_content['menu']; } protected function _initKeepSession() { $interval = (int) Qs_Constant::get('SESSION_REFRESH_INTERVAL'); if ($interval) { $this->addScript('js/lib/keep-session.js') ->addInlineScript('keepSession', ' $(document).ready(function(){ keepSession = new Qs_KeepSession(); keepSession.setInterval(' . $interval . '); keepSession.setUrl("' . BASE_URL_LANGUAGE . '/keep-session"); keepSession.start(); }); '); } return $this; } protected function _initSTSAuthLink() { if (class_exists('App_Admin_StsAuth_View') && class_exists('App_Admin_StsAuth_Obj') && (null != ($alias = Qs_SiteMap::getAliasByItem('Admin_StsAuth_')))) { $textLink = App_Settings_Obj::get('stsAuthLink'); $stsView = new App_Admin_StsAuth_View(); if ($alias && $textLink && ($stsView->dataObj->getStsLoginEnabled() == 'y')) { $this->assign('STS_AUTH_LINK', str_replace('{url}', BASE_URL_LANGUAGE . '/' . $alias, $textLink)); } } return $this; } }