From 840d2d8ec569a28e9436f49f353321699f8757e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 May 2007 08:16:41 +0000 Subject: [PATCH] Gestion erreur --- htdocs/install/upgrade.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index c1144755054..951482c60aa 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -93,12 +93,13 @@ if (! isset($_GET["action"]) || $_GET["action"] == "upgrade") print ""; print $langs->trans("ServerConnection")." : $dolibarr_main_db_host".$langs->trans("OK").""; dolibarr_install_syslog($langs->trans("ServerConnection")." : $dolibarr_main_db_host ".$langs->trans("OK")); - $ok = 1 ; + $ok = 1; } else { - print "".$langs->trans("ErrorFailedToCreateDatabase",$dolibarr_main_db_name)."".$langs->trans("Error").""; - dolibarr_install_syslog($langs->trans("ErrorFailedToCreateDatabase",$dolibarr_main_db_name)); + print "".$langs->trans("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)."".$langs->trans("Error").""; + dolibarr_install_syslog($langs->trans("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)); + $ok = 0; } if ($ok) @@ -108,11 +109,13 @@ if (! isset($_GET["action"]) || $_GET["action"] == "upgrade") print ""; print $langs->trans("DatabaseConnection")." : ".$dolibarr_main_db_name."".$langs->trans("OK").""; dolibarr_install_syslog("Database connection successfull : $dolibarr_main_db_name"); - } + $ok=1; + } else { print "".$langs->trans("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)."".$langs->trans("Error").""; - $ok = 0 ; + dolibarr_install_syslog($langs->trans("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)); + $ok=0; } } @@ -278,7 +281,7 @@ if (! isset($_GET["action"]) || $_GET["action"] == "upgrade") print ''; - $db->close(); + if ($db->connected) $db->close(); } else {