From 73e36ebadaaea6628e17b5fc572ee7e87d2c1b6c Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Sun, 19 Jul 2015 00:30:30 +0530 Subject: [PATCH] Make visibility of Reload privs notice conditional Signed-off-by: Deven Bansod --- libraries/server_privileges.lib.php | 55 +++++++++++++++++++---------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 301b2838eb..dba914bc2c 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -4267,24 +4267,43 @@ function PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir) if (! $GLOBALS['is_ajax_request'] || ! empty($_REQUEST['ajax_page_request']) ) { - $flushnote = new PMA_Message( - __( - 'Note: phpMyAdmin gets the users\' privileges directly ' - . 'from MySQL\'s privilege tables. The content of these tables ' - . 'may differ from the privileges the server uses, ' - . 'if they have been changed manually. In this case, ' - . 'you should %sreload the privileges%s before you continue.' - ), - PMA_Message::NOTICE - ); - $flushLink = ''; - $flushnote->addParam( - $flushLink, - false - ); - $flushnote->addParam('', false); + if (isset($GLOBALS['flush_priv']) && $GLOBALS['flush_priv']) { + $flushnote = new PMA_Message( + __( + 'Note: phpMyAdmin gets the users\' privileges directly ' + . 'from MySQL\'s privilege tables. The content of these tables ' + . 'may differ from the privileges the server uses, ' + . 'if they have been changed manually. In this case, ' + . 'you should %sreload the privileges%s before you continue.' + ), + PMA_Message::NOTICE + ); + $flushLink = ''; + $flushnote->addParam( + $flushLink, + false + ); + $flushnote->addParam('', false); + } else { + $flushnote = new PMA_Message( + __( + 'Note: phpMyAdmin gets the users\' privileges directly ' + . 'from MySQL\'s privilege tables. The content of these tables ' + . 'may differ from the privileges the server uses, ' + . 'if they have been changed manually. In this case, ' + . 'the privileges have to be reloaded but currently, you don\'t have ' + . 'the RELOAD privilege.' + ) + . PMA_Util::showMySQLDocu( + 'privileges-provided', + false, + 'priv_reload' + ), + PMA_Message::NOTICE + ); + } $html_output .= $flushnote->getDisplay(); } }