From 55ad62a0ac8414412073a0f0efd725ddf4e5e44c Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 31 Dec 2013 15:13:34 +0100 Subject: [PATCH] Fix hidden initials_table when reloading filtered mode Signed-off-by: J.M --- libraries/server_privileges.lib.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 34df06392485..94530e3f6b35 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -3790,7 +3790,10 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) . __('Users overview') . "\n" . '' . "\n"; - $sql_query = 'SELECT *,' . + // $sql_query is for the initial-filtered, + // $sql_query_all is for counting the total no. of users + + $sql_query = $sql_query_all = 'SELECT *,' . " IF(`Password` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`'; @@ -3799,9 +3802,15 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) : ''); $sql_query .= ' ORDER BY `User` ASC, `Host` ASC;'; + $sql_query_all .= ' ;'; + $res = $GLOBALS['dbi']->tryQuery( $sql_query, null, PMA_DatabaseInterface::QUERY_STORE ); + $res_all = $GLOBALS['dbi']->tryQuery( + $sql_query_all, null, PMA_DatabaseInterface::QUERY_STORE + ); + if (! $res) { // the query failed! This may have two reasons: @@ -3836,9 +3845,9 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) /** * Displays the initials - * Also not necassary if there is less than 20 privileges + * Also not necessary if there is less than 20 privileges */ - if ($GLOBALS['dbi']->numRows($res) > 20 ) { + if ($GLOBALS['dbi']->numRows($res_all) > 20) { $html_output .= PMA_getHtmlForDisplayTheInitials($array_initials); }