diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php
index cdfc69caba..867385fa17 100644
--- a/libraries/server_privileges.lib.php
+++ b/libraries/server_privileges.lib.php
@@ -2528,8 +2528,11 @@ function PMA_getUsersOverview($result, $db_rights, $link_edit, $pmaThemeImage,
. PMA_Util::showHint(
__('Note: MySQL privilege names are expressed in English')
)
- . '' . "\n"
- . '
' . __('Grant') . ' | ' . "\n"
+ . '' . "\n";
+ if ($GLOBALS['cfgRelation']['menuswork']) {
+ $html_output .= '' . __('User group') . ' | ' . "\n";
+ }
+ $html_output .= '' . __('Grant') . ' | ' . "\n"
. '' . __('Action') . ' | ' . "\n"
. '' . "\n"
. '' . "\n";
@@ -2578,6 +2581,20 @@ function PMA_getUsersOverview($result, $db_rights, $link_edit, $pmaThemeImage,
*/
function PMA_getTableBodyForUserRightsTable($db_rights, $link_edit, $link_export)
{
+ if ($GLOBALS['cfgRelation']['menuswork']) {
+ $usersTable = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb'])
+ . "." . PMA_Util::backquote($GLOBALS['cfg']['Server']['users']);
+ $sqlQuery = "SELECT * FROM " . $usersTable;
+ $result = PMA_queryAsControlUser($sqlQuery, false);
+ $groupAssignment = array();
+ if ($result) {
+ while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
+ $groupAssignment[$row['username']] = $row['usergroup'];
+ }
+ }
+ $GLOBALS['dbi']->freeResult($result);
+ }
+
$odd_row = true;
$index_checkbox = 0;
$html_output = '';
@@ -2620,8 +2637,16 @@ function PMA_getTableBodyForUserRightsTable($db_rights, $link_edit, $link_export
$html_output .= '' . "\n"
. '' . implode(',' . "\n" . ' ', $host['privs']) . "\n"
- . ' | ' . "\n"
- . ''
+ . ' | ' . "\n";
+ if ($GLOBALS['cfgRelation']['menuswork']) {
+ $html_output .= '' . "\n"
+ . (isset($groupAssignment[$host['User']])
+ ? $groupAssignment[$host['User']]
+ : ''
+ )
+ . ' | ' . "\n";
+ }
+ $html_output .= ''
. ($host['Grant_priv'] == 'Y' ? __('Yes') : __('No'))
. ' | ' . "\n"
. ''
@@ -3171,6 +3196,7 @@ function PMA_getHtmlForListingUsersofAGroup($userGroup)
. '';
}
}
+ $GLOBALS['dbi']->freeResult($result);
return $html_output;
}
|