From a16959071c2c414576b7f33f8636ab23bb7ce618 Mon Sep 17 00:00:00 2001 From: Lakshay arora Date: Thu, 12 Jul 2018 11:18:16 +0530 Subject: [PATCH] Apply suggested changes. Signed-Off-By: Lakshay arora --- js/ajax.js | 4 ++-- .../Plugins/Auth/AuthenticationCookie.php | 8 ++++--- libraries/classes/Util.php | 21 ++++++++++--------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/js/ajax.js b/js/ajax.js index 56d650777d..3aabc32937 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -351,7 +351,7 @@ var AJAX = { * To refer to self use 'AJAX', instead of 'this' as this function * is called in the jQuery context. * - * @param object e Event data + * @param object data Event data * * @return void */ @@ -418,7 +418,7 @@ var AJAX = { // reload page if user trying to login has changed if(typeof data.user_changed !== 'undefined' && data.user_changed == 1) { window.location = "index.php"; - PMA_ajaxShowMessage("Loading...", false); + PMA_ajaxShowMessage(PMA_messages.strLoading, false); AJAX.active = false; AJAX.xhr = null; return; diff --git a/libraries/classes/Plugins/Auth/AuthenticationCookie.php b/libraries/classes/Plugins/Auth/AuthenticationCookie.php index 5cb942a909..11a9287498 100644 --- a/libraries/classes/Plugins/Auth/AuthenticationCookie.php +++ b/libraries/classes/Plugins/Auth/AuthenticationCookie.php @@ -131,9 +131,11 @@ class AuthenticationCookie extends AuthenticationPlugin // wrap the login form in a div which overlays the whole page. if($session_expired) { - echo $this->template->render('login/header', ['theme' => $GLOBALS['PMA_Theme'], 'add_class' => ' modal_form', 'session_expired' => 1]); + echo $this->template->render('login/header', ['theme' => $GLOBALS['PMA_Theme'], + 'add_class' => ' modal_form', 'session_expired' => 1]); } else { - echo $this->template->render('login/header', ['theme' => $GLOBALS['PMA_Theme'], 'add_class' => '', 'session_expired' => 0]); + echo $this->template->render('login/header', ['theme' => $GLOBALS['PMA_Theme'], + 'add_class' => '', 'session_expired' => 0]); } if ($GLOBALS['cfg']['DBG']['demo']) { @@ -670,7 +672,7 @@ class AuthenticationCookie extends AuthenticationPlugin // needed for PHP-CGI (not need for FastCGI or mod-php) $response->header('Cache-Control: no-store, no-cache, must-revalidate'); $response->header('Pragma: no-cache'); - + $this->showLoginForm(); } diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php index 156ed2dbe4..37d679f35b 100644 --- a/libraries/classes/Util.php +++ b/libraries/classes/Util.php @@ -4242,6 +4242,17 @@ class Util { $template = new Template(); + if (isset($_REQUEST['session_max_rows'])) { + $rows = $_REQUEST['session_max_rows']; + } else if (isset($_SESSION['tmpval']['max_rows']) + && $_SESSION['tmpval']['max_rows'] != 'all' + ) { + $rows = $_SESSION['tmpval']['max_rows']; + } else { + $rows = $GLOBALS['cfg']['MaxRows']; + $_SESSION['tmpval']['max_rows'] = $rows; + } + if(isset($_REQUEST['pos'])) { $pos = $_REQUEST['pos']; } else if(isset($_SESSION['tmpval']['pos'])) { @@ -4252,16 +4263,6 @@ class Util $_SESSION['tmpval']['pos'] = $pos; } - if (isset($_REQUEST['session_max_rows'])) { - $rows = $_REQUEST['session_max_rows']; - } else { - if (isset($_SESSION['tmpval']['max_rows']) && $_SESSION['tmpval']['max_rows'] != 'all') { - $rows = $_SESSION['tmpval']['max_rows']; - } else { - $rows = $GLOBALS['cfg']['MaxRows']; - $_SESSION['tmpval']['max_rows'] = $rows; - } - } return $template->render('start_and_number_of_rows_panel', [ 'pos' => $pos, 'unlim_num_rows' => intval($_REQUEST['unlim_num_rows']),