diff --git a/ChangeLog b/ChangeLog
index df051a605a..194ecea3f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@ phpMyAdmin - ChangeLog
- issue #11728 CSV import skip row count after
- issue Fixed displaying of SQL query on table operations
- issue #6321 Display binary strings as text if they are valid UTF-8
++ issue #11743 Display routine specific privileges
4.5.4.0 (not yet released)
- issue #11724 live data edit of big sets is not working
diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php
index e26589cc7a..0a1ef4f7e0 100644
--- a/libraries/server_privileges.lib.php
+++ b/libraries/server_privileges.lib.php
@@ -2404,6 +2404,71 @@ function PMA_getListOfPrivilegesAndComparedPrivileges()
return array($list_of_privileges, $listOfComparedPrivs);
}
+/**
+ * Get the HTML for routine based privileges
+ *
+ * @param string $db database name
+ * @param string $odd_row row styling
+ * @param string $index_checkbox starting index for rows to be added
+ *
+ * @return string $html_output
+ */
+function PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $odd_row, $index_checkbox)
+{
+ $sql_query = 'SELECT * FROM `mysql`.`procs_priv` WHERE Db = "' . $db . '";';
+ $response = PMA\libraries\Response::getInstance();
+ $res = $GLOBALS['dbi']->query($sql_query);
+ $html_output = '';
+ while ($row = $GLOBALS['dbi']->fetchAssoc($res)) {
+
+ $html_output .= '
';
+
+ $html_output .= ' | ';
+
+ $html_output .= '' . $row['User']
+ . ' | '
+ . '' . $row['Host']
+ . ' | '
+ . '' . 'routine'
+ . ' | '
+ . '' . '' . $row['Routine_name'] . ''
+ . ' | '
+ . '' . 'Yes'
+ . ' | ';
+ $current_user = $row['User'];
+ $current_host = $row['Host'];
+ $routine = $row['Routine_name'];
+ $html_output .= '';
+ if ($GLOBALS['is_grantuser']) {
+ $specific_db = (isset($row['Db']) && $row['Db'] != '*')
+ ? $row['Db'] : '';
+ $specific_table = (isset($row['Table_name'])
+ && $row['Table_name'] != '*')
+ ? $row['Table_name'] : '';
+ $html_output .= PMA_getUserLink(
+ 'edit',
+ $current_user,
+ $current_host,
+ $specific_db,
+ $specific_table,
+ $routine
+ );
+ }
+ $html_output .= ' | ';
+
+ $html_output .= '
';
+ $odd_row = !$odd_row;
+
+ }
+ return $html_output;
+}
+
/**
* Get the HTML for user form and check the privileges for a particular database.
*
@@ -2695,6 +2760,9 @@ function PMA_getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db)
$odd_row = ! $odd_row;
}
}
+
+ //For fetching routine based privileges
+ $html_output .= PMA_getHtmlTableBodyForSpecificDbRoutinePrivs($db, $odd_row, $index_checkbox);
$html_output .= '';
return $html_output;
@@ -4455,6 +4523,9 @@ function PMA_getListForExportUserDefinition($username, $hostname)
// export privileges for selected users
$title = __('Privileges');
+ //For removing duplicate entries of users
+ $_REQUEST['selected_usr'] = array_unique($_REQUEST['selected_usr']);
+
foreach ($_REQUEST['selected_usr'] as $export_user) {
$export_username = /*overload*/mb_substr(
$export_user, 0, /*overload*/mb_strpos($export_user, '&')