Skip to content

Commit

Permalink
Fix hidden initials_table when reloading filtered mode
Browse files Browse the repository at this point in the history
Signed-off-by: J.M <me@mynetx.net>
  • Loading branch information
mynetx committed Dec 31, 2013
1 parent 3b8bfb9 commit 55ad62a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions libraries/server_privileges.lib.php
Expand Up @@ -3790,7 +3790,10 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir)
. __('Users overview') . "\n"
. '</h2>' . "\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`';

Expand All @@ -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:
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 55ad62a

Please sign in to comment.