diff --git a/ChangeLog b/ChangeLog index d788dcbbf..dc8b98f47 100755 --- a/ChangeLog +++ b/ChangeLog @@ -69,6 +69,8 @@ $Source$ filename format (RFE #1362423). * Documentation.html, index.php: Add target parameter to index.php to allow direct jump to any script. + * libraries/auth/cookie.auth.lib.php: Remember selected page when login + time outs. 2005-11-22 Sebastian Mendel * added test/theme.php: for testing themes diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index 64d5c4307..5da425821 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -219,6 +219,9 @@ echo sprintf( $GLOBALS['strWelcome'], ' . "\n"; + } if (isset($GLOBALS['db'])) { echo ' ' . "\n"; } @@ -464,16 +467,16 @@ function PMA_auth_set_user() $GLOBALS['SERVER_SOFTWARE'] = $_SERVER['SERVER_SOFTWARE']; } } // end if + $redirect_url = $cfg['PmaAbsoluteUri'] . 'index.php?' + . PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', + isset($GLOBALS['table']) ? $GLOBALS['table'] : '', '&') + . (!empty($GLOBALS['target']) ? '&target=' . urlencode($GLOBALS['target']) : '') + . '&' . SID; if (!empty($GLOBALS['SERVER_SOFTWARE']) && $GLOBALS['SERVER_SOFTWARE'] == 'Microsoft-IIS/5.0') { - header('Refresh: 0; url=' . $cfg['PmaAbsoluteUri'] . 'index.php?' . - PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', - isset($GLOBALS['table']) ? $GLOBALS['table'] : '', - '&')); + header('Refresh: 0; url=' . $redirect_url); } else { - header( 'Location: ' . $cfg['PmaAbsoluteUri'] . 'index.php?' - . PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', - isset($GLOBALS['table']) ? $GLOBALS['table'] : '', '&') . '&' . SID ); + header('Location: ' . $redirect_url); } exit(); } // end if @@ -500,6 +503,10 @@ global $conn_error, $server; $conn_error = $GLOBALS['strAccessDenied']; } else if (isset($GLOBALS['no_activity']) && $GLOBALS['no_activity']) { $conn_error = sprintf($GLOBALS['strNoActivity'],$GLOBALS['cfg']['LoginCookieValidity']); + // Remember where we got timeout to return on same place + if (isset($_SERVER['SCRIPT_NAME'])) { + $GLOBALS['target'] = basename($_SERVER['SCRIPT_NAME']); + } } else if (PMA_DBI_getError()) { $conn_error = PMA_sanitize(PMA_DBI_getError()); } else if (isset($php_errormsg)) {