From 71024bc478309e07ba1125011cab2536b48b65ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Apr 2005 20:56:18 +0000 Subject: [PATCH] Fix: Suppression des warnings de l'install quand php en mode error_reporting=E_ALL. --- htdocs/install/etape2.php | 12 +++++++----- htdocs/install/etape4.php | 13 ++++++++----- htdocs/install/fileconf.php | 2 ++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index 4f508a8ffaa..68a0274ec9e 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -39,8 +39,10 @@ $langs->defaultlang=$setuplang; $langs->load("admin"); $langs->load("install"); + pHeader($langs->trans("CreateDatabaseObjects"),"etape4"); +$grant_query=''; $etape = 2; if (file_exists($conffile)) @@ -145,7 +147,7 @@ if ($_POST["action"] == "set") } else { - if ($db->errno() == DB_ERROR_TABLE_ALREADY_EXISTS) + if ($db->errno() == 'DB_ERROR_TABLE_ALREADY_EXISTS') { //print "Déjà existante"; $table_exists = 1; @@ -217,7 +219,7 @@ if ($_POST["action"] == "set") } else { - if ($db->errno() == DB_ERROR_CANNOT_CREATE || eregi('duplicate key name',$db->error())) + if ($db->errno() == 'DB_ERROR_CANNOT_CREATE' || eregi('duplicate key name',$db->error())) { //print "Déjà existante"; $key_exists = 1; @@ -253,7 +255,7 @@ if ($_POST["action"] == "set") if ($ok) { // Droits sur les tables - if ($grant_query) { + if ($grant_query) { // Non null si postgresql if ($db->query($grant_query)) { print "Grant User".$langs->trans("OK").""; @@ -300,7 +302,7 @@ if ($_POST["action"] == "set") } else { - if ($db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS) + if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { // print "Insertion ligne : $buffer } @@ -355,7 +357,7 @@ if ($_POST["action"] == "set") } else { - if ($db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS) + if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { // print "Insertion ligne : $buffer } diff --git a/htdocs/install/etape4.php b/htdocs/install/etape4.php index 4628e555a65..0a96b20a38c 100644 --- a/htdocs/install/etape4.php +++ b/htdocs/install/etape4.php @@ -54,7 +54,7 @@ require ($dolibarr_main_document_root . "/conf/conf.class.php"); print ''; -$error=0; +$err=0; $conf = new Conf(); $conf->db->type = $dolibarr_main_db_type; @@ -76,24 +76,27 @@ if ($db->ok == 1) print ''; print '
'; - if ($_GET["error"] == 1) + if (isset($_GET["error"]) && $_GET["error"] == 1) { print '
'.$langs->trans("PasswordsMismatch").'
'; } - if ($_GET["error"] == 2) + if (isset($_GET["error"]) && $_GET["error"] == 2) { print '
'; print $langs->trans("PleaseTypePassword"); print '
'; } - if ($_GET["error"] == 3) + if (isset($_GET["error"]) && $_GET["error"] == 3) { print '
'.$langs->trans("PleaseTypeALogin").'
'; } - $db->close(); + } +$db->close(); + pFooter($err); + ?> diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 957afa0e5d3..cfaeeabb954 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -33,6 +33,8 @@ include_once("./inc.php"); +$err=0; + $setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:$langcode); $langs->defaultlang=$setuplang; $langs->load("install");