The branch, master has been updated via 288329402cf5f2f0d5e3645495b25174caa7b099 (commit) from 32b9a47a556c45e30c2974e60cb7155408ad698f (commit)
- Log ----------------------------------------------------------------- commit 288329402cf5f2f0d5e3645495b25174caa7b099 Author: Sílvio Soares Ribeiro Júnior silviojr@dcc.ufmg.br Date: Thu Apr 7 11:29:10 2011 +0200
Show error when adding new user which already exists
-----------------------------------------------------------------------
Summary of changes: server_privileges.php | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/server_privileges.php b/server_privileges.php index 51127ce..e436143 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -890,6 +890,7 @@ if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { $message = PMA_Message::error(__('The user %s already exists!')); $message->addParam('[i]'' . $username . ''@'' . $hostname . ''[/i]'); $_REQUEST['adduser'] = true; + $_add_user_error = true; } else {
$create_user_real = 'CREATE USER '' . PMA_sqlAddslashes($username) . ''@'' . PMA_sqlAddslashes($hostname) . '''; @@ -1385,7 +1386,7 @@ $link_export = '<a class="export_user_anchor ' . $conditional_class . '" href="s * If we are in an Ajax request for Create User/Edit User/Revoke User/Flush Privileges, * show $message and exit. */ -if( $GLOBALS['is_ajax_request'] && !isset($_REQUEST['export']) && !isset($_REQUEST['adduser']) && !isset($_REQUEST['initial']) && !isset($_REQUEST['showall']) && !isset($_REQUEST['edit_user_dialog'])) { +if( $GLOBALS['is_ajax_request'] && !isset($_REQUEST['export']) && (!isset($_REQUEST['adduser']) || $_add_user_error) && !isset($_REQUEST['initial']) && !isset($_REQUEST['showall']) && !isset($_REQUEST['edit_user_dialog'])) {
if(isset($sql_query)) { $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
hooks/post-receive