anonymous user

This commit is contained in:
Marc Delisle
2002-12-01 12:43:32 +00:00
parent 7e195319e1
commit db133f8189
2 changed files with 35 additions and 16 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2002-12-01 Marc Delisle <lem9@users.sourceforge.net>
* user_details.php3: the script wrongly created a user % when asked
to create an anonymous user (should be empty)
2002-11-29 Michal Cihar <nijel@users.sourceforge.net> 2002-11-29 Michal Cihar <nijel@users.sourceforge.net>
* lang/czech*.php3: Updated translation. * lang/czech*.php3: Updated translation.

View File

@@ -402,13 +402,13 @@ function PMA_normalOperations()
</tr> </tr>
<tr> <tr>
<td> <td>
<input type="radio" name="anyuser" id="radio_anyuser0" /> <input type="radio" name="anyuser" value="1" id="radio_anyuser1" />
<label for="radio_anyuser0"><?php echo $GLOBALS['strAnyUser']; ?></label> <label for="radio_anyuser1"><?php echo $GLOBALS['strAnyUser']; ?></label>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<input type="radio" name="anyuser" id="radio_anyuser1" checked="checked" /> <input type="radio" name="anyuser" value="0" id="radio_anyuser0" checked="checked" />
<label for="radio_anyuser1"><?php echo $GLOBALS['strUserName']; ?></label>&nbsp;:&nbsp; <label for="radio_anyuser0"><?php echo $GLOBALS['strUserName']; ?></label>&nbsp;:&nbsp;
</td> </td>
<td> <td>
<input type="text" name="pma_user" size="10" class="textfield" <?php echo $GLOBALS['chg_evt_handler']; ?>="this.form.anyuser[1].checked = true" /> <input type="text" name="pma_user" size="10" class="textfield" <?php echo $GLOBALS['chg_evt_handler']; ?>="this.form.anyuser[1].checked = true" />
@@ -711,12 +711,12 @@ function PMA_editOperations($host, $user)
</tr> </tr>
<tr> <tr>
<td> <td>
<input type="radio" value="1" name="anyuser" id="radio_anyuser1"<?php if ($user == '' || $user == '%') echo ' checked="checked"'; ?> /> <input type="radio" value="1" name="anyuser" id="radio_anyuser1"<?php if ($user == '') echo ' checked="checked"'; ?> />
<label for="radio_anyuser1"><?php echo $GLOBALS['strAnyUser']; ?></label> <label for="radio_anyuser1"><?php echo $GLOBALS['strAnyUser']; ?></label>
</td> </td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<input type="radio" value="0" name="anyuser" id="radio_anyuser0"<?php if ($user != '' && $user != '%') echo ' checked="checked"'; ?> /> <input type="radio" value="0" name="anyuser" id="radio_anyuser0"<?php if ($user != '') echo ' checked="checked"'; ?> />
<label for="radio_anyuser0"><?php echo $GLOBALS['strUserName']; ?></label>&nbsp;:&nbsp; <label for="radio_anyuser0"><?php echo $GLOBALS['strUserName']; ?></label>&nbsp;:&nbsp;
</td> </td>
<td> <td>
@@ -1125,8 +1125,19 @@ else if (isset($submit_addUser)) {
if (!isset($host) || $host == '') { if (!isset($host) || $host == '') {
$host = '%'; $host = '%';
} }
if (!isset($pma_user) || $pma_user == '') { //if (!isset($pma_user) || $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 '<p><b>' . $strError . '&nbsp;:&nbsp;' . $strUserEmpty . '</b></p>' . "\n";
unset($host);
unset($pma_user);
$forgot_checkbox_any_user = TRUE;
} }
// Password is not confirmed // Password is not confirmed
@@ -1143,7 +1154,7 @@ else if (isset($submit_addUser)) {
} }
// Password confirmed // Password confirmed
else { else if (!isset($forgot_checkbox_any_user)) {
$sql_query = ''; $sql_query = '';
$list_priv = array('Select', 'Insert', 'Update', 'Delete', 'Create', 'Drop', 'Reload', $list_priv = array('Select', 'Insert', 'Update', 'Delete', 'Create', 'Drop', 'Reload',
'Shutdown', 'Process', 'File', 'Grant', 'References', 'Index', 'Alter'); 'Shutdown', 'Process', 'File', 'Grant', 'References', 'Index', 'Alter');
@@ -1181,8 +1192,11 @@ else if (isset($submit_updProfile)) {
if (!isset($host) || $host == '') { if (!isset($host) || $host == '') {
$host = '%'; $host = '%';
} }
if (!isset($pma_user) || $pma_user == '') { //if (!isset($pma_user) || $pma_user == '') {
$pma_user = '%'; // $pma_user = '%';
//}
if (!isset($pma_user)) {
$pma_user = '';
} }
// Builds the sql query // Builds the sql query
@@ -1198,13 +1212,15 @@ else if (isset($submit_updProfile)) {
} else if (isset($new_server)) { } else if (isset($new_server)) {
unset($new_server); unset($new_server);
} }
if (isset($anyuser) && $anyuser=="1") {
if (isset($anyuser) && $anyuser) { //$new_user = '%';
$new_user = '%'; // anonymous user must be empty, not %
$new_user = '';
} else if ($new_user != '' && get_magic_quotes_gpc()) { } else if ($new_user != '' && get_magic_quotes_gpc()) {
$new_user = stripslashes($new_user); $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) ? '' : ', ') $common_upd .= (empty($common_upd) ? '' : ', ')
. 'User = \'' . PMA_sqlAddslashes($new_user) . '\''; . 'User = \'' . PMA_sqlAddslashes($new_user) . '\'';
} else if (isset($new_user)) { } else if (isset($new_user)) {
@@ -1237,7 +1253,6 @@ else if (isset($submit_updProfile)) {
if (!empty($sql_query)) { if (!empty($sql_query)) {
$common_where = ' WHERE Host = \'' . PMA_sqlAddslashes($host) . '\' AND User = \'' . PMA_sqlAddslashes($pma_user) . '\''; $common_where = ' WHERE Host = \'' . PMA_sqlAddslashes($host) . '\' AND User = \'' . PMA_sqlAddslashes($pma_user) . '\'';
// Updates profile // Updates profile
$local_query = 'UPDATE user SET ' . $local_query . $common_where; $local_query = 'UPDATE user SET ' . $local_query . $common_where;
$sql_query_cpy = 'UPDATE user SET ' . $sql_query . $common_where; $sql_query_cpy = 'UPDATE user SET ' . $sql_query . $common_where;