diff --git a/ChangeLog b/ChangeLog index ad3e2e3e0..b9a5eb1e9 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-02-18 Alexander M. Turek + * server_databases.php3: + - Fixed bug #688360 (Database privileges and AllowUserDropDatabase); + - The link "check privileges" is now only displayed to superusers. + 2003-02-17 Michal Cihar * lang/czech: Updated. * Documentation.html: Removed obsolete FAQ 6.17 about binary upload. diff --git a/server_databases.php3 b/server_databases.php3 index 34d5190ec..f0a5d1aaa 100644 --- a/server_databases.php3 +++ b/server_databases.php3 @@ -7,9 +7,6 @@ * Checks if the left frame has to be reloaded */ require('./libraries/grab_globals.lib.php3'); -if (!empty($drop_selected_dbs)) { - $reload = 1; -} /** @@ -57,7 +54,7 @@ if ($server > 0 && empty($dblist)) { /** * Drops multiple databases */ -if (!empty($drop_selected_dbs)) { +if (!empty($drop_selected_dbs) && ($is_superuser || $cfg['AllowUserDropDatabase'])) { if (empty($selected_db)) { $message = $strNoDatabasesSelected; } else { @@ -76,6 +73,7 @@ if (!empty($drop_selected_dbs)) { $message = sprintf($strDatabasesDropped, count($selected_db)); // we need to reload the database list now. PMA_availableDatabases(); + $reload = 1; } } @@ -155,7 +153,7 @@ if (count($statistics) > 0) { . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" - . ' ' . "\n" + . ($is_superuser || $cfg['AllowUserDropDatabase'] ? ' ' . "\n" : '') . ' ' . "\n"; } - echo ' ' . "\n" - . ' ' . "\n"; + if ($is_superuser) { + echo ' ' . "\n"; + } + echo ' ' . "\n"; $useBgcolorOne = TRUE; $total_calc = array( 'db_cnt' => 0, @@ -225,11 +225,13 @@ if (count($statistics) > 0) { $total_calc['data_sz'] += $current['data_sz']; $total_calc['idx_sz'] += $current['idx_sz']; $total_calc['tot_sz'] += $current['tot_sz']; - echo ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n"; + if ($is_superuser || $cfg['AllowUserDropDatabase']) { + echo ' ' . "\n"; + } + echo ' ' . "\n"; } - echo ' ' . "\n" - . ' ' . "\n"; + if ($is_superuser) { + echo ' ' . "\n"; + } + echo ' ' . "\n"; $useBgcolorOne = !$useBgcolorOne; } // end while if (!empty($dbstats)) { @@ -337,14 +341,16 @@ if (count($statistics) > 0) { . ' ' . "\n" . ' ' . "\n"; } - echo '

' . "\n" - . '
  • ' . "\n" - . ' ' . "\n" - . ' ' . $strDropSelectedDatabases . "\n" - . '
    ' . "\n" - . ' ' . "\n" - . '
  • ' . "\n" - . ' ' . "\n" + if ($is_superuser || $cfg['AllowUserDropDatabase']) { + echo '

    ' . "\n" + . '
  • ' . "\n" + . ' ' . "\n" + . ' ' . $strDropSelectedDatabases . "\n" + . '
    ' . "\n" + . ' ' . "\n" + . '
  • ' . "\n"; + } + echo ' ' . "\n" . '' . "\n"; } else { echo $strNoDatabases . "\n";
      ' . "\n" . '  '; if (empty($dbstats)) { @@ -204,10 +202,12 @@ if (count($statistics) > 0) { . '  ' . "\n" . ' ' . "\n" - . '  ' . $strAction . ' ' . "\n" - . '
    ' . "\n" + . '  ' . $strAction . ' ' . "\n" + . '
    ' . "\n" - . ' ' . "\n" - . ' ' . "\n" + echo '
    ' . "\n" + . ' ' . "\n" + . ' ' . "\n" . ' ' . "\n" . ' ' . htmlspecialchars($current['db_name']) . "\n" . ' ' . "\n" @@ -261,12 +263,14 @@ if (count($statistics) > 0) { . ' ' . "\n" . ' ' . "\n" - . ' '. "\n" - . ' ' . $strCheckPrivs . "\n" - . ' ' . "\n" - . '
    ' . "\n" + . ' '. "\n" + . ' ' . $strCheckPrivs . "\n" + . ' ' . "\n" + . '