Project

General

Profile

Bug #19950 » 10322_v2.diff

Administrator Admin, 2009-02-03 14:50

View differences:

typo3/backend.php (working copy)
htmlspecialchars(t3lib_div::locationHeaderUrl('gfx/clear.gif')) .
'";
/**
* Function similar to PHPs rawurlencode();
*/
......
function busy() { //
this.loginRefreshed = busy_loginRefreshed;
this.openRefreshWindow = busy_OpenRefreshWindow;
this.openLockedWaitWindow = busy_openLockedWaitWindow;
this.busyloadTime=0;
this.openRefreshW=0;
this.reloginCancelled=0;
this.earlyRelogin=0;
this.locked=0;
// starts the timer and resets the earlyRelogin variable so that
// the countdown works properly.
this.startTimer = function() {
......
this.timer = new Ajax.PeriodicalUpdater("","ajax.php", {
method: "get",
frequency: 60,
decay: 1,
parameters: "ajaxID=BackendLogin::isTimedOut&skipSessionUpdate=1",
onSuccess: function(e) {
var login = e.responseJSON.login.evalJSON();
if(login.timed_out) {
if(login.locked) {
busy.locked = 1;
busy.openLockedWaitWindow();
} else if(login.timed_out) {
busy.openRefreshWindow();
}
if (busy.locked && !login.locked && !login.timed_out) {
busy.locked = 0;
Ext.MessageBox.hide();
}
}
});
......
this.earlyRelogin=0;
}
function busy_openLockedWaitWindow() {
Ext.MessageBox.show({
title: "' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.please_wait') . '",
msg: "' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.be_locked') . '",
progressText: "' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.be_locked_waitingforremoval') . '",
width:500,
progress:true,
closable:false,
});
}
function busy_OpenRefreshWindow() {
this.openRefreshW = 1;
typo3/classes/class.ajaxlogin.php (working copy)
*/
function isTimedOut($params = array(), TYPO3AJAX &$ajaxObj = null) {
if(is_object($GLOBALS['BE_USER'])) {
$GLOBALS['BE_USER']->fetchUserSession(true);
$ses_tstamp = $GLOBALS['BE_USER']->user['ses_tstamp'];
$timeout = $GLOBALS['BE_USER']->auth_timeout_field;
if (@is_file(PATH_typo3conf.'LOCK_BACKEND')) {
$ajaxObj->addContent('login', '{timed_out: false,locked:true}');
$ajaxObj->setContentFormat('json');
} else {
$GLOBALS['BE_USER']->fetchUserSession(true);
$ses_tstamp = $GLOBALS['BE_USER']->user['ses_tstamp'];
$timeout = $GLOBALS['BE_USER']->auth_timeout_field;
// if 120 seconds from now is later than the session timeout, we need to show the refresh dialog.
// 120 is somewhat arbitrary to allow for a little room during the countdown and load times, etc.
if($GLOBALS['EXEC_TIME'] >= $ses_tstamp+$timeout-120) {
$ajaxObj->addContent('login', '{timed_out: true}');
$ajaxObj->setContentFormat('json');
} else {
$ajaxObj->addContent('login', '{timed_out: false}');
$ajaxObj->setContentFormat('json');
// if 120 seconds from now is later than the session timeout, we need to show the refresh dialog.
// 120 is somewhat arbitrary to allow for a little room during the countdown and load times, etc.
if($GLOBALS['EXEC_TIME'] >= $ses_tstamp+$timeout-120) {
$ajaxObj->addContent('login', '{timed_out: true}');
$ajaxObj->setContentFormat('json');
} else {
$ajaxObj->addContent('login', '{timed_out: false}');
$ajaxObj->setContentFormat('json');
}
}
} else {
$ajaxObj->addContent('login', '{success: false, error: "No BE_USER object"}');
typo3/init.php (working copy)
exit; // ... and exit good!
}
if (!(defined('TYPO3_cliMode') && TYPO3_cliMode) && @is_file(PATH_typo3conf.'LOCK_BACKEND')) {
$fContent = t3lib_div::getUrl(PATH_typo3conf.'LOCK_BACKEND');
if ($fContent) {
header('Location: '.$fContent); // Redirect
if (TYPO3_PROCEED_IF_NO_USER === 1) {
// ajax poll for login, let him pass
} else {
die('Browser backend is locked for maintenance. Remove lock by removing the file "typo3conf/LOCK_BACKEND" or use CLI-scripts.'.chr(10).chr(10));
$fContent = t3lib_div::getUrl(PATH_typo3conf.'LOCK_BACKEND');
if ($fContent) {
header('Location: '.$fContent); // Redirect
} else {
die('Browser backend is locked for maintenance. Remove lock by removing the file "typo3conf/LOCK_BACKEND" or use CLI-scripts.'.chr(10).chr(10));
}
exit;
}
exit;
}
// **********************
typo3/sysext/lang/locallang_core.xml (working copy)
<label index="mess.refresh_login_username">Username</label>
<label index="mess.refresh_login_password">Password</label>
<label index="mess.refresh_login_button">Login</label>
<label index="mess.please_wait">Please wait ...</label>
<label index="mess.be_locked">Backend is locked - please be patient and don't close browser</label>
<label index="mess.be_locked_waitingforremoval">waiting for lock removal</label>
<label index="mess.login_about_to_expire">Your TYPO3 login is about to expire. Please confirm that you want to stay logged in.</label>
<label index="mess.login_about_to_expire_title">TYPO3 login expiration notice</label>
<label index="mess.login_expired">Your TYPO3 login has expired. You need to login again if you want to continue. Otherwise you can close the current browser window.</label>
(4-4/4)