setSuModeOff(); } $this->setSuModeOn(); } if ($this->getAuth()->getSuMode()) { $this->setBodyAttrib('class', 'su'); } } public function renderPageItems($items) { $siteChanger = App_SitesChange_AdminLoginView::getInstance(); $this->_siteChangeForm = $siteChanger->renderSitesChangeForm(); $siteChanger->exec(); return parent::renderPageItems($items); } public function setSuModeOn() { $this->getAuth()->setSuMode(); $this->setRedirectMessage('Su Mode Enabled'); $url = Qs_Request::getUrlExclude('su'); Qs_Http::redirect($url); } public function exec() { $siteChange = App_SitesAutologin_AdminView::getInstance(); $siteChange->addSitesChangeForm(); return parent::exec(); } 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(); } 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; } public function getSiteChangeForm() { return $this->_siteChangeForm; } }