fixed bug #1811519 Can't delete user with a german umlaut.

return to privileges pages in case of error in drop user
This commit is contained in:
Sebastian Mendel
2007-10-12 12:16:48 +00:00
parent 59f4fdcc16
commit ac69f1cad1
2 changed files with 12 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
#1787915 #1787915
+ [lang] Croatian update, thanks to Renato Pavicic + [lang] Croatian update, thanks to Renato Pavicic
- patch #1807615 [GUI] Display patch for column rights in Opera - patch #1807615 [GUI] Display patch for column rights in Opera
- bug #1811519 Can't delete user with a german umlaut.
2.11.1.1 (not yet released) 2.11.1.1 (not yet released)
- bug #1810629 [setup] XSS in setup.php, thanks to Omer Singer, The DigiTrust Group - bug #1810629 [setup] XSS in setup.php, thanks to Omer Singer, The DigiTrust Group

View File

@@ -1217,13 +1217,21 @@ if (isset($_REQUEST['delete']) || (isset($_REQUEST['change_copy']) && $_REQUEST[
$queries[] = '# ' . $GLOBALS['strReloadingThePrivileges'] . ' ...'; $queries[] = '# ' . $GLOBALS['strReloadingThePrivileges'] . ' ...';
$queries[] = 'FLUSH PRIVILEGES;'; $queries[] = 'FLUSH PRIVILEGES;';
} }
$drop_user_error = '';
foreach ($queries as $sql_query) { foreach ($queries as $sql_query) {
if ($sql_query{0} != '#') { if ($sql_query{0} != '#') {
PMA_DBI_query($sql_query, $GLOBALS['userlink']); if (! PMA_DBI_try_query($sql_query, $GLOBALS['userlink'])) {
$drop_user_error .= PMA_DBI_getError() . "\n";
}
} }
} }
$sql_query = join("\n", $queries); $sql_query = join("\n", $queries);
$message = new PMA_Message('strUsersDeleted', PMA_Message::SUCCESS); if (! empty($drop_user_error)) {
$message = PMA_Message::error();
$message->setMessage($drop_user_error);
} else {
$message = PMA_Message::success('strUsersDeleted');
}
} }
unset($queries); unset($queries);
} }
@@ -1454,7 +1462,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
echo ' <tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n" echo ' <tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n"
. ' <td><input type="checkbox" name="selected_usr[]" id="checkbox_sel_users_' . ' <td><input type="checkbox" name="selected_usr[]" id="checkbox_sel_users_'
. $index_checkbox . '" value="' . $index_checkbox . '" value="'
. str_replace(chr(27), '&#27;', htmlentities($host['User'] . $user_host_separator . $host['Host'])) . str_replace(chr(27), '&#27;', htmlspecialchars($host['User'] . $user_host_separator . $host['Host']))
. '"' . '"'
. (empty($GLOBALS['checkall']) ? '' : ' checked="checked"') . (empty($GLOBALS['checkall']) ? '' : ' checked="checked"')
. ' /></td>' . "\n" . ' /></td>' . "\n"