setSuModeOff(); } $this->setSuModeOn(); } if ($this->getAuth()->getSuMode()) { $this->setBodyAttrib('class', 'su'); } } 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); } public function getAuth() { if (null === $this->_auth) { $this->_auth = App_Admin_Auth::getInstance(); } return $this->_auth; } public function getAuthAdapter() { if (null === $this->_authAdapter) { $this->_authAdapter = new App_Admin_AuthAdapter(); } return $this->_authAdapter; } 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(); } 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; } }