From db133f8189c093f5fda8c9abb5d4afb846bf7fe9 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 1 Dec 2002 12:43:32 +0000 Subject: [PATCH] anonymous user --- ChangeLog | 4 ++++ user_details.php3 | 47 +++++++++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0cccbf205..845af6a81 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-12-01 Marc Delisle + * user_details.php3: the script wrongly created a user % when asked + to create an anonymous user (should be empty) + 2002-11-29 Michal Cihar * lang/czech*.php3: Updated translation. diff --git a/user_details.php3 b/user_details.php3 index e1fc92185..c793f4c55 100644 --- a/user_details.php3 +++ b/user_details.php3 @@ -402,13 +402,13 @@ function PMA_normalOperations() - - + +   - -  :  + +  :  ="this.form.anyuser[1].checked = true" /> @@ -711,12 +711,12 @@ function PMA_editOperations($host, $user) - /> + />   - /> + />  :  @@ -1125,8 +1125,19 @@ else if (isset($submit_addUser)) { if (!isset($host) || $host == '') { $host = '%'; } - if (!isset($pma_user) || $pma_user == '') { - $pma_user = '%'; + //if (!isset($pma_user) || $pma_user == '') { + // $pma_user = '%'; + //} + if (isset($anyuser) && $anyuser=="1") { + $pma_user = ''; + + // this is for the case where js is disabled, so they did not get + // the error before submitting + } else if (isset($pma_user) && empty($pma_user)) { + echo '

' . $strError . ' : ' . $strUserEmpty . '

' . "\n"; + unset($host); + unset($pma_user); + $forgot_checkbox_any_user = TRUE; } // Password is not confirmed @@ -1143,7 +1154,7 @@ else if (isset($submit_addUser)) { } // Password confirmed - else { + else if (!isset($forgot_checkbox_any_user)) { $sql_query = ''; $list_priv = array('Select', 'Insert', 'Update', 'Delete', 'Create', 'Drop', 'Reload', 'Shutdown', 'Process', 'File', 'Grant', 'References', 'Index', 'Alter'); @@ -1181,8 +1192,11 @@ else if (isset($submit_updProfile)) { if (!isset($host) || $host == '') { $host = '%'; } - if (!isset($pma_user) || $pma_user == '') { - $pma_user = '%'; + //if (!isset($pma_user) || $pma_user == '') { + // $pma_user = '%'; + //} + if (!isset($pma_user)) { + $pma_user = ''; } // Builds the sql query @@ -1198,13 +1212,15 @@ else if (isset($submit_updProfile)) { } else if (isset($new_server)) { unset($new_server); } - - if (isset($anyuser) && $anyuser) { - $new_user = '%'; + if (isset($anyuser) && $anyuser=="1") { + //$new_user = '%'; + // anonymous user must be empty, not % + $new_user = ''; } else if ($new_user != '' && get_magic_quotes_gpc()) { $new_user = stripslashes($new_user); } - if ($new_user != '' && $new_user != $pma_user) { + //if ($new_user != '' && $new_user != $pma_user) { + if ($new_user != $pma_user) { $common_upd .= (empty($common_upd) ? '' : ', ') . 'User = \'' . PMA_sqlAddslashes($new_user) . '\''; } else if (isset($new_user)) { @@ -1237,7 +1253,6 @@ else if (isset($submit_updProfile)) { if (!empty($sql_query)) { $common_where = ' WHERE Host = \'' . PMA_sqlAddslashes($host) . '\' AND User = \'' . PMA_sqlAddslashes($pma_user) . '\''; - // Updates profile $local_query = 'UPDATE user SET ' . $local_query . $common_where; $sql_query_cpy = 'UPDATE user SET ' . $sql_query . $common_where;