From d5be8964ba83473bd5433ea79341b620d0254db6 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Mon, 18 Aug 2008 12:09:56 -0400 Subject: [PATCH] Fixed a bug were index.html gets overwriten when a subdomain is added. --- server/plugins-available/mysql_clientdb_plugin.inc.php | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php index 4699379..81ada6e 100644 --- a/server/plugins-available/mysql_clientdb_plugin.inc.php +++ b/server/plugins-available/mysql_clientdb_plugin.inc.php @@ -105,6 +105,7 @@ $link = mysql_connect($clientdb_host, $clientdb_user, $clientdb_password); if (!$link) { $app->log('Unable to connect to the database'.mysql_error($link),LOGLEVEL_ERROR); + return; } //* Rename User @@ -164,6 +165,7 @@ $link = mysql_connect($clientdb_host, $clientdb_user, $clientdb_password); if (!$link) { $app->log('Unable to connect to the database'.mysql_error($link),LOGLEVEL_ERROR); + return; } //* Get the db host setting for the access priveliges @@ -173,11 +175,17 @@ $db_host = 'localhost'; } - mysql_query("DROP USER '".addslashes($data["old"]["database_user"])."'@'$db_host';",$link); - $app->log('Dropping mysql user: '.$data["old"]["database_user"],LOGLEVEL_DEBUG); + if(mysql_query("DROP USER '".addslashes($data["old"]["database_user"])."'@'$db_host';",$link)) { + $app->log('Dropping mysql user: '.$data["old"]["database_user"],LOGLEVEL_DEBUG); + } else { + $app->log('Error while dropping mysql user: '.$data["old"]["database_user"].' '.mysql_error($link),LOGLEVEL_ERROR); + } - mysql_query('DROP DATABASE '.addslashes($data["old"]["database_name"]),$link); - $app->log('Dropping mysql database: '.$data["old"]["database_name"],LOGLEVEL_DEBUG); + if(mysql_query('DROP DATABASE '.addslashes($data["old"]["database_name"]),$link)) { + $app->log('Dropping mysql database: '.$data["old"]["database_name"],LOGLEVEL_DEBUG); + } else { + $app->log('Error while dropping mysql database: '.$data["old"]["database_name"].' '.mysql_error($link),LOGLEVEL_ERROR); + } mysql_query("FLUSH PRIVILEGES;",$link); -- Gitblit v1.9.1