#!/usr/local/bin/perl # drop_dbase.cgi # Drop an existing database require './postgresql-lib.pl'; &ReadParse(); &error_setup($text{'ddrop_err'}); &can_edit_db($in{'db'}) || &error($text{'dbase_ecannot'}); if ($in{'confirm'}) { # Drop the database &execute_sql_logged($config{'basedb'}, "drop database \"$in{'db'}\""); &webmin_log("delete", "db", $in{'db'}); &redirect(""); } else { # Ask the user if he is sure.. &ui_print_header(undef, $text{'ddrop_title'}, ""); @tables = &list_tables($in{'db'}); $rows = 0; foreach $t (@tables) { $d = &execute_sql($in{'db'}, "select count(*) from $t"); $rows += $d->{'data'}->[0]->[0]; } print "
\n"; print "