diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index dc6f8161c8a..2c9d405bc30 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -156,6 +156,12 @@ if ($HTTP_POST_VARS["action"] == "set") */ if ($error == 0) { + // Defini $dolibarr_... + if (file_exists($conf)) + { + include($conf); + } + require ($dolibarr_main_document_root . "/lib/mysql.lib.php"); require ($dolibarr_main_document_root . "/conf/conf.class.php"); @@ -166,14 +172,13 @@ if ($HTTP_POST_VARS["action"] == "set") $conf->db->name = "mysql"; $conf->db->user = isset($HTTP_POST_VARS["db_user_root"])?$HTTP_POST_VARS["db_user_root"]:""; $conf->db->pass = isset($HTTP_POST_VARS["db_user_pass"])?$HTTP_POST_VARS["db_user_pass"]:""; + //print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->pass; $db = new DoliDb(); $sql = "INSERT INTO user "; $sql .= "(Host,User,password)"; $sql .= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_user',password('$dolibarr_main_db_pass'))"; - $db->query($sql); - $sql = "INSERT INTO db "; $sql .= "(Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv)"; $sql .= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_name','$dolibarr_main_db_user'"; @@ -194,7 +199,7 @@ if ($HTTP_POST_VARS["action"] == "set") } else { - print "Création de l'utilisateur : $dolibarr_main_db_userERREUR"; + print "Création de l'utilisateur : $dolibarr_main_db_userERREUR ".$db->error().""; } } @@ -229,7 +234,7 @@ if ($HTTP_POST_VARS["action"] == "set") // // Connexion base existante // - print "Connexion réussie à la base : $dolibarr_main_db_nameOK"; + print "Connexion à la base : $dolibarr_main_db_nameOK"; $ok = 1 ; } @@ -238,7 +243,6 @@ if ($HTTP_POST_VARS["action"] == "set") // // Création de la base // - print "Echec de connexion à la base : $dolibarr_main_db_nameWarning"; print 'Création de la base : '.$dolibarr_main_db_name.''; diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index e915b034f91..e4be3ef163b 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -21,7 +21,7 @@ * */ include("./inc.php"); -pHeader("Fichier de configuration","etape4"); +pHeader("Création des objets de la base","etape4"); $etape = 2; @@ -51,7 +51,7 @@ if ($HTTP_POST_VARS["action"] == "set") $ok = 0; if ($db->connected == 1) { - print "Connexion réussie au serveur : $dolibarr_main_db_hostOK"; + print "Connexion au serveur : $dolibarr_main_db_hostOK"; $ok = 1 ; } else @@ -113,7 +113,7 @@ if ($HTTP_POST_VARS["action"] == "set") if ($db->query($buffer)) { - print "OK"; + //print "OK"; } else { @@ -125,7 +125,7 @@ if ($HTTP_POST_VARS["action"] == "set") else { print "Création de la table $name"; - print "ERREUR ".$db->errno().""; + print "ERREUR ".$db->errno()." ".$db->error().""; $error++; } } @@ -136,7 +136,7 @@ if ($HTTP_POST_VARS["action"] == "set") if ($error == 0) { - print 'Création des tables réussie'; + print 'Création des tables et clés primairesOK'; $ok = 1; } } @@ -169,13 +169,13 @@ if ($HTTP_POST_VARS["action"] == "set") } else { - $ok = 0; if ($db->errno() == 1062) { // print "Insertion ligne : $bufferDéja existante"; } else { + $ok = 0; print "Erreur SQL ".$db->errno()." sur requete '$buffer': ".$db->error()."
"; } } @@ -191,6 +191,7 @@ if ($HTTP_POST_VARS["action"] == "set") } else { + print "ERREUR"; $ok = 1 ; } }