Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

bug fix 4148 #738

Merged
merged 3 commits into from

4 participants

@scnakandala

No description provided.

@coveralls

Coverage Status

Coverage remained the same when pulling ba137a8 on scnakandala:master into 3065a3e on phpmyadmin:master.

libraries/server_privileges.lib.php
@@ -2233,6 +2233,24 @@ function PMA_getUserExportLink($username, $hostname, $initial = '')
}
/**
+ * Returns user group edit link
+ *
+ * @param string $username User name
+ *
+ * @return HTML code with link
+ */
+function PMA_getUserGroupEditLink($username)
+{
+ return '<a class="edit_user_group_anchor ajax"'
+ . ' href="server_privileges.php'
+ . PMA_URL_getCommon(array('username' => $username))
+ . '">'
+ . PMA_Util::getIcon('b_usrlist.png', __('Edit user group'))
+ . '</a>'
+ . '</td>';
@madhuracj Collaborator

Extra </td>. Better to have HTML tags in balance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
libraries/server_privileges.lib.php
((13 lines not shown))
$new_user_string .= '<td>';
-
+
@madhuracj Collaborator

Please remove trailing white spaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@coveralls

Coverage Status

Coverage remained the same when pulling d0631be on scnakandala:master into 3065a3e on phpmyadmin:master.

@lem9 lem9 was assigned
@lem9
Owner

Thanks.

@lem9 lem9 merged commit 60d91b4 into phpmyadmin:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 1, 2013
  1. @scnakandala

    bug fix 4148

    scnakandala authored
Commits on Nov 2, 2013
  1. @scnakandala

    balanced html tags

    scnakandala authored
  2. @scnakandala
This page is out of date. Refresh to see the latest.
Showing with 34 additions and 8 deletions.
  1. +34 −8 libraries/server_privileges.lib.php
View
42 libraries/server_privileges.lib.php
@@ -2233,6 +2233,23 @@ function PMA_getUserExportLink($username, $hostname, $initial = '')
}
/**
+ * Returns user group edit link
+ *
+ * @param string $username User name
+ *
+ * @return HTML code with link
+ */
+function PMA_getUserGroupEditLink($username)
+{
+ return '<a class="edit_user_group_anchor ajax"'
+ . ' href="server_privileges.php'
+ . PMA_URL_getCommon(array('username' => $username))
+ . '">'
+ . PMA_Util::getIcon('b_usrlist.png', __('Edit user group'))
+ . '</a>';
+}
+
+/**
* This function return the extra data array for the ajax behavior
*
* @param string $password password
@@ -2291,7 +2308,14 @@ function PMA_getExtraDataForAjaxBehavior(
$new_user_string .= '<td>'
. '<code>' . join(', ', PMA_extractPrivInfo('', true)) . '</code>'
. '</td>'; //Fill in privileges here
- $new_user_string .= '<td class="usrGroup"></td>';
+
+ // if $cfg['Servers'][$i]['users'] and $cfg['Servers'][$i]['usergroups'] are
+ // enabled
+ $cfgRelation = PMA_getRelationsParam();
+ if (isset($cfgRelation['users']) && isset($cfgRelation['usergroups'])) {
+ $new_user_string .= '<td class="usrGroup"></td>';
+ }
+
$new_user_string .= '<td>';
if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y')) {
@@ -2305,6 +2329,13 @@ function PMA_getExtraDataForAjaxBehavior(
$new_user_string .= '<td>'
. PMA_getUserEditLink($username, $hostname)
. '</td>' . "\n";
+
+ if (isset($cfgRelation['users']) && isset($cfgRelation['usergroups'])) {
+ $new_user_string .= '<td>'
+ . PMA_getUserGroupEditLink($username)
+ . '</td>' . "\n";
+ }
+
$new_user_string .= '<td>'
. PMA_getUserExportLink(
$username,
@@ -2975,13 +3006,8 @@ function PMA_getTableBodyForUserRightsTable($db_rights)
$html_output .= '<td class="center"></td>';
} else {
$html_output .= '<td class="center">'
- . '<a class="edit_user_group_anchor ajax"'
- . ' href="server_privileges.php'
- . PMA_URL_getCommon(array('username' => $host['User']))
- . '">'
- . PMA_Util::getIcon('b_usrlist.png', __('Edit user group'))
- . '</a>'
- . '</td>';
+ . PMA_getUserGroupEditLink($host['User'])
+ .'</td>';
}
}
$html_output .= '<td class="center">'
Something went wrong with that request. Please try again.