From d06bfbea0abb178062448919bff1964bbc71a449 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Thu, 12 May 2011 08:13:50 +0000 Subject: [PATCH] 2011-05-12 Juan Manuel Ramon * install.php: Correct a mistake that doesn't allow to create a new database when drop database option is checked. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4339 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/install.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f77f8994a6..82e99b3c0e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-05-12 Juan Manuel Ramon + + * install.php: Correct a mistake that doesn't allow to create a + new database when drop database option is checked. + 2011-05-11 Miguel de Dios * operation/search_modules.php, operation/search_agents.php, diff --git a/pandora_console/install.php b/pandora_console/install.php index cad5b0583e..7e8d08bfb4 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -701,7 +701,7 @@ function install_step4() { } // Create schema - if ($dbaction != 'db_exist'){ + if ($dbaction != 'db_exist' || $dbdrop == 1){ $step1 = mysql_query ("CREATE DATABASE $dbname"); check_generic ($step1, "Creating database '$dbname'"); } @@ -839,7 +839,7 @@ function install_step4() { $result = pg_query($connection, "DROP DATABASE \"" . $dbname . "\";"); } - if ($dbaction != 'db_exist'){ + if ($dbaction != 'db_exist' || $dbdrop == 1){ pg_send_query($connection, "CREATE DATABASE \"" . $dbname . "\" WITH ENCODING 'utf8';"); $result = pg_get_result($connection); if (pg_result_status($result) != PGSQL_FATAL_ERROR) {