From 26bd0018e3eb2c07e915a06dd282595548b74ee5 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 9 Jul 2015 18:12:01 +0530 Subject: [PATCH] Show a warning when a user account allowing any user from localhost to connect Signed-off-by: Madhura Jayaratne --- libraries/server_privileges.lib.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index ce7a6e5e65..2bee606270 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -4224,6 +4224,22 @@ function PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir) // for all initials, even non A-Z $array_initials = array(); + foreach ($db_rights as $right) { + foreach ($right as $account) { + if (empty($account['User']) && $account['Host'] == 'localhost') { + $html_output .= PMA_Message::notice( + __( + 'A user account allowing any user from localhost to ' + . 'connect is present. This may cause trouble for ' + . 'other users who are allowed to connect from any ' + . 'host in connecting.' + ) + )->getDisplay(); + break 2; + } + } + } + /** * Displays the initials * Also not necessary if there is less than 20 privileges