break; case 'reconnect': //display error login window on top of login form $loginError = "\n\t\tAutomne.message.popup({\n\t\t\tmsg: '{$cms_language->getJsMessage(MESSAGE_ERROR_SESSION_EXPIRED)}',\n\t\t\tbuttons: Ext.MessageBox.OK,\n\t\t\ticon: Ext.MessageBox.ERROR,\n\t\t\tfn:function() {\n\t\t\t\tloginWindow.body.mask('{$cms_language->getJsMessage(MESSAGE_PAGE_PLEASE_WAIT)}');\n\t\t\t\tloginWindow.reload();\n\t\t\t}\n\t\t});"; //Disconnect user CMS_session::authenticate(array('disconnect' => true, 'type' => 'admin')); break; case '': //launch authentification process (for modules which can use it) CMS_session::authenticate(array('authenticate' => true, 'type' => 'admin')); $cms_user = CMS_session::getUser(); if ($cms_user && $cms_user->hasAdminAccess()) { //launch the daily routine incase it's not in the cron CMS_module_standard::processDailyRoutine(); //then set context and load Automne interface $userSessionsInfos = CMS_session::getSessionInfos(); $cms_language = $cms_user->getLanguage(); //welcome message $welcome = $cms_language->getJsMessage(MESSAGE_PAGE_USER_WELCOME, array($userSessionsInfos['fullname'])); $welcomeMsg = ''; //last login $logs = CMS_log_catalog::search('', 0, $cms_user->getUserId(), array(CMS_log::LOG_ACTION_AUTO_LOGIN, CMS_log::LOG_ACTION_LOGIN), false, false, 0, 2, 'datetime', 'desc', false); if (isset($logs[1])) { $welcomeMsg .= '<br /><br />' . $cms_language->getJsMessage(MESSAGE_PAGE_PREVIOUS_LOGIN) . ' ' . $logs[1]->getDateTime()->getLocalizedDate($cms_language->getDateFormat() . ' H:i:s'); } //validations if ($userSessionsInfos['hasValidations']) { $welcomeMsg .= '<br /><br />' . ($userSessionsInfos['awaitingValidation'] ? $cms_language->getJsMessage(MESSAGE_PAGE_USER_VALIDATIONS, array($userSessionsInfos['awaitingValidation'])) : $cms_language->getJsMessage(MESSAGE_PAGE_USER_NOVALIDATION)); } //debug if (SYSTEM_DEBUG && $cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) {
/** * Get current session infos * * @return array : the user session infos * @access public * @static */ static function getSessionInfos() { return CMS_session::getSessionInfos(); }