From ece1ae6b177f282713cfeddf059aebb97cb25d81 Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Mon, 5 Nov 2012 22:10:39 +0000 Subject: [PATCH] Fixed bug #3583343 - Incorrect page after expired session --- libraries/Footer.class.php | 4 +++- .../plugins/auth/AuthenticationCookie.class.php | 14 ++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/Footer.class.php b/libraries/Footer.class.php index b0c1a0fa92..f12dce913b 100644 --- a/libraries/Footer.class.php +++ b/libraries/Footer.class.php @@ -106,11 +106,13 @@ class PMA_Footer { $db = ! empty($GLOBALS['db']) ? $GLOBALS['db'] : ''; $table = ! empty($GLOBALS['table']) ? $GLOBALS['table'] : ''; + $target = ! empty($_REQUEST['target']) ? $_REQUEST['target'] : ''; return basename(PMA_getenv('SCRIPT_NAME')) . PMA_generate_common_url( array( 'db' => $db, 'table' => $table, - 'server' => $GLOBALS['server'] + 'server' => $GLOBALS['server'], + 'target' => $target ), $encoding ); diff --git a/libraries/plugins/auth/AuthenticationCookie.class.php b/libraries/plugins/auth/AuthenticationCookie.class.php index 47b326c851..752a1ec129 100644 --- a/libraries/plugins/auth/AuthenticationCookie.class.php +++ b/libraries/plugins/auth/AuthenticationCookie.class.php @@ -19,6 +19,12 @@ require_once 'libraries/plugins/AuthenticationPlugin.class.php'; */ if (! empty($_REQUEST['target'])) { $GLOBALS['target'] = $_REQUEST['target']; +} else if (PMA_getenv('SCRIPT_NAME')) { + $GLOBALS['target'] = basename(PMA_getenv('SCRIPT_NAME')); + // avoid "missing parameter: field" on re-entry + if ('tbl_alter.php' == $GLOBALS['target']) { + $GLOBALS['target'] = 'tbl_structure.php'; + } } /** @@ -581,14 +587,6 @@ class AuthenticationCookie extends AuthenticationPlugin __('No activity within %s seconds; please log in again'), $GLOBALS['cfg']['LoginCookieValidity'] ); - // Remember where we got timeout to return on same place - if (PMA_getenv('SCRIPT_NAME')) { - $GLOBALS['target'] = basename(PMA_getenv('SCRIPT_NAME')); - // avoid "missing parameter: field" on re-entry - if ('tbl_alter.php' == $GLOBALS['target']) { - $GLOBALS['target'] = 'tbl_structure.php'; - } - } } elseif (PMA_DBI_getError()) { $conn_error = '#' . $GLOBALS['errno'] . ' ' . __('Cannot log in to the MySQL server');