Remember selected page when login time outs.

This commit is contained in:
Michal Čihař
2005-11-23 20:31:47 +00:00
parent f370db5942
commit c82587ab32
2 changed files with 16 additions and 7 deletions

View File

@@ -69,6 +69,8 @@ $Source$
filename format (RFE #1362423). filename format (RFE #1362423).
* Documentation.html, index.php: Add target parameter to index.php to * Documentation.html, index.php: Add target parameter to index.php to
allow direct jump to any script. allow direct jump to any script.
* libraries/auth/cookie.auth.lib.php: Remember selected page when login
time outs.
2005-11-22 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2005-11-22 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* added test/theme.php: for testing themes * added test/theme.php: for testing themes

View File

@@ -219,6 +219,9 @@ echo sprintf( $GLOBALS['strWelcome'],
<input type="hidden" name="lang" value="<?php echo $lang; ?>" /> <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" /> <input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<?php <?php
if (isset($GLOBALS['target'])) {
echo ' <input type="hidden" name="target" value="' . htmlspecialchars($GLOBALS['target']) . '" />' . "\n";
}
if (isset($GLOBALS['db'])) { if (isset($GLOBALS['db'])) {
echo ' <input type="hidden" name="db" value="' . htmlspecialchars($GLOBALS['db']) . '" />' . "\n"; echo ' <input type="hidden" name="db" value="' . htmlspecialchars($GLOBALS['db']) . '" />' . "\n";
} }
@@ -464,16 +467,16 @@ function PMA_auth_set_user()
$GLOBALS['SERVER_SOFTWARE'] = $_SERVER['SERVER_SOFTWARE']; $GLOBALS['SERVER_SOFTWARE'] = $_SERVER['SERVER_SOFTWARE'];
} }
} // end if } // 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') { if (!empty($GLOBALS['SERVER_SOFTWARE']) && $GLOBALS['SERVER_SOFTWARE'] == 'Microsoft-IIS/5.0') {
header('Refresh: 0; url=' . $cfg['PmaAbsoluteUri'] . 'index.php?' . header('Refresh: 0; url=' . $redirect_url);
PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '',
isset($GLOBALS['table']) ? $GLOBALS['table'] : '',
'&'));
} }
else { else {
header( 'Location: ' . $cfg['PmaAbsoluteUri'] . 'index.php?' header('Location: ' . $redirect_url);
. PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '',
isset($GLOBALS['table']) ? $GLOBALS['table'] : '', '&') . '&' . SID );
} }
exit(); exit();
} // end if } // end if
@@ -500,6 +503,10 @@ global $conn_error, $server;
$conn_error = $GLOBALS['strAccessDenied']; $conn_error = $GLOBALS['strAccessDenied'];
} else if (isset($GLOBALS['no_activity']) && $GLOBALS['no_activity']) { } else if (isset($GLOBALS['no_activity']) && $GLOBALS['no_activity']) {
$conn_error = sprintf($GLOBALS['strNoActivity'],$GLOBALS['cfg']['LoginCookieValidity']); $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()) { } else if (PMA_DBI_getError()) {
$conn_error = PMA_sanitize(PMA_DBI_getError()); $conn_error = PMA_sanitize(PMA_DBI_getError());
} else if (isset($php_errormsg)) { } else if (isset($php_errormsg)) {