From 5ddc03eb7c17907fb6f483c92704a4662913f462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 5 Dec 2006 10:24:14 +0000 Subject: [PATCH] Backport from trunk. --- ChangeLog | 5 +++++ server_privileges.php | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c94c1e2c3..f2e80f01f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - ChangeLog $Id$ $Source$ +2006-12-05 Michal Čihař + * server_privileges.php: Add IF NOT EXISTS to CREATE DATABASE query (RFE + #1608372), reload navigation after creating database. + * server_privileges.php: Use correct links (patch #1607236). + 2006-12-04 Marc Delisle * db_details_structure.php, bug #1605985, missing HTML tag diff --git a/server_privileges.php b/server_privileges.php index cdc36eb50..212597e96 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -470,8 +470,8 @@ function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = . $spaces . '
' . "\n" . $spaces . ' ' . "\n" . $spaces . ' ' . ($db == '*' ? $GLOBALS['strGlobalPrivileges'] : ($table == '*' ? $GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges'])) . "\n" - . $spaces . ' ( ' . $GLOBALS['strCheckAll'] . ' /' . "\n" - . $spaces . ' ' . $GLOBALS['strUncheckAll'] . ' )' . "\n" + . $spaces . ' ( ' . $GLOBALS['strCheckAll'] . ' /' . "\n" + . $spaces . ' ' . $GLOBALS['strUncheckAll'] . ' )' . "\n" . $spaces . ' ' . "\n" . $spaces . '

' . $GLOBALS['strEnglishPrivileges'] . '

' . "\n" . $spaces . '
' . "\n" @@ -834,9 +834,11 @@ if (!empty($adduser_submit) || !empty($change_copy)) { /* Create database for new user */ if (isset($createdb) && $createdb > 0) { if ($createdb == 1) { - $q = 'CREATE DATABASE ' . PMA_backquote(PMA_sqlAddslashes($username)) . ';'; + $q = 'CREATE DATABASE IF NOT EXISTS ' . PMA_backquote(PMA_sqlAddslashes($username)) . ';'; $sql_query .= $q; PMA_DBI_try_query($q) or PMA_mysqlDie(PMA_DBI_getError(), $sql_query); + $GLOBALS['reload'] = TRUE; + PMA_reloadNavigation(); $q = 'GRANT ALL PRIVILEGES ON ' . PMA_backquote(PMA_sqlAddslashes($username)) . '.* TO \'' . PMA_sqlAddslashes($username) . '\'@\'' . $hostname . '\';'; $sql_query .= $q; @@ -1413,12 +1415,12 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) echo ''; foreach ($array_initials as $tmp_initial => $initial_was_found) { if ($initial_was_found) { - echo '' . "\n"; + echo '' . "\n"; } else { echo ''; } } - echo '' . "\n"; + echo '' . "\n"; echo '
' . $tmp_initial . '' . $tmp_initial . '' . $tmp_initial . '[' . $GLOBALS['strShowAll'] . '][' . $GLOBALS['strShowAll'] . ']
'; /** @@ -1494,7 +1496,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) ) .' src="' . $pmaThemeImage . 'arrow_' . $text_dir . '.png"' .' width="38" height="22"' .' alt="' . $GLOBALS['strWithChecked'] . '" />' . "\n" - .'' . $GLOBALS['strCheckAll'] . '' . "\n" .'/' . "\n"