From 5f7084b8e3c909a91cab6a9222f6e75589e6fa92 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 3 Jan 2010 16:01:49 +0000 Subject: [PATCH] rfe #838637 Export user privileges --- ChangeLog | 3 ++- server_privileges.php | 34 ++++++++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e23baeeaf..d7bcbfa01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,8 @@ $Id$ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $ 3.4.0.0 (not yet released) -+ rfe #2890226 [view] enable VIEW rename ++ rfe #2890226 [view] Enable VIEW rename ++ rfe #838637 [privileges] Export a user's privileges 3.3.0.0 (not yet released) + rfe #2308632 [edit] Use hex for (var)binary fields, diff --git a/server_privileges.php b/server_privileges.php index b3b8b5292..9f052926e 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -790,7 +790,6 @@ function PMA_displayLoginInformationFields($mode = 'new') . '' . "\n"; } // end of the 'PMA_displayUserAndHostFields()' function - /** * Changes / copies a user, part I */ @@ -1334,9 +1333,30 @@ $link_revoke = '' + . PMA_getIcon('b_tblexport.png', $GLOBALS['strExport']) + . ''; + /** * Displays the page */ + +// export user definition +if (isset($_REQUEST['export'])) { + echo '

' . $GLOBALS['strUser'] . ' \'' . htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname) . '\'

'; + echo ''; + unset($_REQUEST['username'], $_REQUEST['hostname'], $username, $hostname, $grants, $one_grant); +} + if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs))) { if (! isset($username)) { // No username is given --> display the overview @@ -1480,7 +1500,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs . ' ' . $GLOBALS['strGlobalPrivileges'] . ' ' . PMA_showHint($GLOBALS['strEnglishPrivileges']) . '' . "\n" . ' ' . $GLOBALS['strGrantOption'] . '' . "\n" - . ' ' . $GLOBALS['strAction'] . '' . "\n"; + . ' ' . $GLOBALS['strAction'] . '' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; @@ -1519,10 +1539,12 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs . ' ' . "\n" . ' ' . ($host['Grant_priv'] == 'Y' ? $GLOBALS['strYes'] : $GLOBALS['strNo']) . '' . "\n" . ' '; - printf($link_edit, urlencode($host['User']), - urlencode($host['Host']), '', ''); - echo '' . "\n" - . ' ' . "\n"; + printf($link_edit, urlencode($host['User']), urlencode($host['Host']), '', ''); + echo ''; + echo ''; + printf($link_export, urlencode($host['User']), urlencode($host['Host']), (isset($initial) ? $initial : '')); + echo ''; + echo ''; $odd_row = ! $odd_row; } }