Correction d'un bug à l'install suite à une configuration mal chargée.
Correction de petits problèmes d'affichages.
This commit is contained in:
parent
b0ec5b87c1
commit
4ca979d035
@ -156,6 +156,12 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
*/
|
*/
|
||||||
if ($error == 0)
|
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 . "/lib/mysql.lib.php");
|
||||||
require ($dolibarr_main_document_root . "/conf/conf.class.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->name = "mysql";
|
||||||
$conf->db->user = isset($HTTP_POST_VARS["db_user_root"])?$HTTP_POST_VARS["db_user_root"]:"";
|
$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"]:"";
|
$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();
|
$db = new DoliDb();
|
||||||
|
|
||||||
$sql = "INSERT INTO user ";
|
$sql = "INSERT INTO user ";
|
||||||
$sql .= "(Host,User,password)";
|
$sql .= "(Host,User,password)";
|
||||||
$sql .= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_user',password('$dolibarr_main_db_pass'))";
|
$sql .= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_user',password('$dolibarr_main_db_pass'))";
|
||||||
|
|
||||||
$db->query($sql);
|
|
||||||
|
|
||||||
$sql = "INSERT INTO db ";
|
$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 .= "(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'";
|
$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
|
else
|
||||||
{
|
{
|
||||||
print "<tr><td>Création de l'utilisateur : $dolibarr_main_db_user</td><td>ERREUR</td></tr>";
|
print "<tr><td>Création de l'utilisateur : $dolibarr_main_db_user</td><td>ERREUR ".$db->error()."</td></tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +234,7 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
//
|
//
|
||||||
// Connexion base existante
|
// Connexion base existante
|
||||||
//
|
//
|
||||||
print "<tr><td>Connexion réussie à la base : $dolibarr_main_db_name</td><td>OK</td></tr>";
|
print "<tr><td>Connexion à la base : $dolibarr_main_db_name</td><td>OK</td></tr>";
|
||||||
|
|
||||||
$ok = 1 ;
|
$ok = 1 ;
|
||||||
}
|
}
|
||||||
@ -238,7 +243,6 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
//
|
//
|
||||||
// Création de la base
|
// Création de la base
|
||||||
//
|
//
|
||||||
|
|
||||||
print "<tr><td>Echec de connexion à la base : $dolibarr_main_db_name</td><td>Warning</td></tr>";
|
print "<tr><td>Echec de connexion à la base : $dolibarr_main_db_name</td><td>Warning</td></tr>";
|
||||||
print '<tr><td colspan="2">Création de la base : '.$dolibarr_main_db_name.'</td></tr>';
|
print '<tr><td colspan="2">Création de la base : '.$dolibarr_main_db_name.'</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
include("./inc.php");
|
include("./inc.php");
|
||||||
pHeader("Fichier de configuration","etape4");
|
pHeader("Création des objets de la base","etape4");
|
||||||
|
|
||||||
$etape = 2;
|
$etape = 2;
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
$ok = 0;
|
$ok = 0;
|
||||||
if ($db->connected == 1)
|
if ($db->connected == 1)
|
||||||
{
|
{
|
||||||
print "<tr><td>Connexion réussie au serveur : $dolibarr_main_db_host</td><td>OK</td></tr>";
|
print "<tr><td>Connexion au serveur : $dolibarr_main_db_host</td><td>OK</td></tr>";
|
||||||
$ok = 1 ;
|
$ok = 1 ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -113,7 +113,7 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
|
|
||||||
if ($db->query($buffer))
|
if ($db->query($buffer))
|
||||||
{
|
{
|
||||||
print "<td>OK</td></tr>";
|
//print "<td>OK</td></tr>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -125,7 +125,7 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<tr><td>Création de la table $name</td>";
|
print "<tr><td>Création de la table $name</td>";
|
||||||
print "<td>ERREUR ".$db->errno()."</td></tr>";
|
print "<td>ERREUR ".$db->errno()." ".$db->error()."</td></tr>";
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
|
|
||||||
if ($error == 0)
|
if ($error == 0)
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="2">Création des tables réussie</td></tr>';
|
print '<tr><td>Création des tables et clés primaires</td><td>OK</td></tr>';
|
||||||
$ok = 1;
|
$ok = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,13 +169,13 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ok = 0;
|
|
||||||
if ($db->errno() == 1062)
|
if ($db->errno() == 1062)
|
||||||
{
|
{
|
||||||
// print "<tr><td>Insertion ligne : $buffer</td><td>Déja existante</td></tr>";
|
// print "<tr><td>Insertion ligne : $buffer</td><td>Déja existante</td></tr>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$ok = 0;
|
||||||
print "Erreur SQL ".$db->errno()." sur requete '$buffer': ".$db->error()."<br>";
|
print "Erreur SQL ".$db->errno()." sur requete '$buffer': ".$db->error()."<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,6 +191,7 @@ if ($HTTP_POST_VARS["action"] == "set")
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
print "<td>ERREUR</td></tr>";
|
||||||
$ok = 1 ;
|
$ok = 1 ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user