__AUTH(); } public function login($p_username,$p_password) { //$confirmLogin = $this->confirmLogin($p_username,$p_password); //if(!$confirmLogin) { $status = parent::login($p_username,$p_password); //} if($status == AUTH_LOGGED_IN) { return array("CMgr.getMODEL().setUser('".utf8_encode($this->getUsername())." ".$this->_getI18N("logout")."');CMgr.getMODEL().__construct();"); } elseif($status == AUTH_CONFIRM_LOGIN){ return array("Browser.getElementById('inp_password').value='';CMgr.getAUTH().setInfoMsg('".$this->_getI18N("authConfirmLoginMsg")."');"); } else { return array("CMgr.getAUTH().setInfoMsg('".$this->_getI18N("authFailedMsg")."');"); } } public function logout() { $MISConfig = new MISConfig(); $status = parent::logout(); $MISConfig->setConfigFile($MISConfig->getDefaultConfigFile()); $projectDOM = new DOMDocument('1.0', 'utf-8'); $projectDOM->load($MISConfig->getConfigFile()); $projectXpath = new DOMXpath($projectDOM); $configName = $projectXpath->query("/Configuration")->item(0)->getAttribute("Name"); return array('CMgr.getMODEL().__construct();CMgr.getMODEL().setConfig("'.$configName.'");CMgr.getMODEL().setUser("'.$this->_getI18N("login").'");'); } public function getMain() { $eval = "Browser.getElementById('inp_username').focus();CMgr.getMODEL().setLocationName('');CMgr.getMODEL().setLeftToolbar('');CMgr.getMODEL().setLeftFootbar('');CMgr.getMODEL().setMainToolbar('');CMgr.getMODEL().setMainFootbar('');CMgr.getMODEL().setMainHead('');CMgr.getMODEL().setUser('".$this->_getI18N("login")."');"; switch($this->getAuthStatus()) { case AUTH_FAILED: $logonInfoMsg = $this->_getI18N("authFailedMsg"); break; case AUTH_LOGGED_IN: $logonInfoMsg = $this->_getI18N("authLoggedInMsg"); break; case AUTH_NOT_LOGGED: $logonInfoMsg = $this->_getI18N("authNotLoggedMsg"); break; case AUTH_LOGGED_OUT: $logonInfoMsg = $this->_getI18N("authLoggedOutMsg"); break; case AUTH_TIMEOUT: $logonInfoMsg = $this->_getI18N("authTimeoutMsg"); break; case AUTH_EXPIRED: $logonInfoMsg = $this->_getI18N("authExpiredMsg"); break; case AUTH_ERROR: $logonInfoMsg = $this->_getI18N("authErrorMsg"); break; case AUTH_SECURITY: $logonInfoMsg = $this->_getI18N("authSecurityMsg"); break; case AUTH_CONFIRM_LOGIN:$logonInfoMsg = $this->_getI18N("authConfirmLoginMsg"); break; } if($this->getAuthStatus() == AUTH_LOGGED_OUT || $this->getAuthStatus() == AUTH_EXPIRED || $this->getAuthStatus() == AUTH_SECURITY) { $eval .= "Cookie.eraseAll();"; } $eval .= "Browser.getElementById('inp_username').focus();"; return array('