diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index ca6f074f9a6..f4f4deaccc7 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio @@ -24,9 +24,9 @@ */ /** - \file htdocs/install/etape1.php - \brief Génère le fichier conf.php avec les informations issues de l'étape précédente - \version $Revision$ + \file htdocs/install/etape1.php + \brief Génère le fichier conf.php avec les informations issues de l'étape précédente + \version $Revision$ */ include_once("./inc.php"); @@ -56,385 +56,432 @@ if (! $main_data_dir) { $main_data_dir="$main_dir/documents"; } if ($_POST["action"] == "set") { - umask(0); - print '

'.$langs->trans("SaveConfigurationFile").'

'; - - print ''; - $error=0; - $fp = fopen("$conffile", "w"); - - if($fp) - { - if (substr($main_dir, strlen($main_dir) -1) == "/") - { - $main_dir = substr($main_dir, 0, strlen($main_dir)-1); - } - - if (substr($_POST["main_url"], strlen($_POST["main_url"]) -1) == "/") - { - $_POST["main_url"] = substr($_POST["main_url"], 0, strlen($_POST["main_url"])-1); - } - - clearstatcache(); - - fwrite($fp, ''); - fclose($fp); - - if (file_exists("$conffile")) - { - include ("$conffile"); - print ""; - $error = 0; - } - else - { - $error = 1; - } - } - - if($dolibarr_main_db_type == "mysql") - { - include_once("../lib/mysql.lib.php"); - $choix=1; - } - else - { - include_once("../lib/pgsql.lib.php"); - $choix=2; - } - - - /*************************************************************************** - * - * Creation des répertoires - * - ***************************************************************************/ - - if ($error == 0) - { - - // Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre téléchargés en passant outre l'authentification - $dir[0] = "$main_data_dir/facture"; - $dir[1] = "$main_data_dir/users"; - $dir[2] = "$main_data_dir/propale"; - $dir[3] = "$main_data_dir/societe"; - $dir[4] = "$main_data_dir/ficheinter"; - $dir[5] = "$main_data_dir/produit"; - $dir[6] = "$main_data_dir/rapport"; - $dir[7] = "$main_data_dir/rsscache"; - $dir[8] = "$main_data_dir/logo"; - + umask(0); + print '

'.$langs->trans("SaveConfigurationFile").'

'; - if (! is_dir($main_dir)) - { - print ""; - $error++; - } - else - { - dolibarr_syslog ("Le dossier '".$main_dir."' existe"); - - // Répertoire des documents - if (! is_dir($main_data_dir)) - { - @mkdir($main_data_dir, 0755); - } - - if (! is_dir($main_data_dir)) - { - print "'; - $error++; - } - else - { - // Boucle sur chaque répertoire de dir[] pour les créer s'ils nexistent pas - for ($i = 0 ; $i < sizeof($dir) ; $i++) - { - if (is_dir($dir[$i])) - { - dolibarr_syslog ("Le dossier '".$dir[$i]."' existe"); - } - else - { - if (! @mkdir($dir[$i], 0755)) - { - print ""; - $error++; - } - else - { - dolibarr_syslog ("Le dossier '".$dir[$i]."' a ete cree"); - } - } - } - } - } - } - - /* - * Base de données - * - */ + print '
".$langs->trans("ConfigurationSaving")."".$langs->trans("OK")."
"; - print $langs->trans("DirDoesNotExists",$main_dir); - print ""; - print $langs->trans("Error"); - print "
Le dossier '$main_data_dir' n'existe pas ! "; - print "Vous devez créer ce dossier et permettre au serveur web d'écrire dans celui-ci"; - print 'Erreur
"; - print "Impossible de créer : ".$dir[$i]; - print ""; - print $langs->trans("Error"); - print "
'; + $error=0; + $fp = fopen("$conffile", "w"); - if ($error == 0) + if($fp) { - include_once($dolibarr_main_document_root . "/conf/conf.class.php"); - - // TODO - // Il y a encore des pb ds la procédure d'install qui ne passe dans pas tous les cas - // (exemple, rien n'existe et on veut créer une base avec un compte admin != root) - // L'algorithme ne semble pas adapté à tous les cas, il devrait etre remplacé par le suivant: - // - // On essaie l'accès par le user admin dolibarr - // si accès serveur ok et accès base ok, tout est ok, on ne va pas plus loin, on a même pas utilisé le compte root. - // si accès serveur ok et accès base ko, warning 1 - // si accès serveur ko, warning 2 - // Si warning, on essai de se connecter au serveur via le super user root - // Si connexion serveur par root ok et accès base ko, on la créée - // Si création ok, on y accède - // Si création ko, erreur - // Si connexion serveur par root ok et si accès base ok, - // si compte admin existe deja et db_create_user positionné, on ajoute les droits, - // si compte admin existe deja et db_create_user non positionné, erreur compte admin incorrect "Le compte admin indiqué existe mais n'a pas les droits sur la base. Veuillez cocher pour les ajouter" - // si compte admin n'existe pas deja et db_create_user positionné, on crée le compte - // si compte admin n'existe pas deja et db_create_user non positionné, erreur compte admin inexistant "Veuillez cocher pour le créer" - - // Si creation utilisateur admin demandée, on le crée - if (isset($_POST["db_create_user"]) && $_POST["db_create_user"] == "on") - { - dolibarr_syslog ("Creation de l'utilisateur : ".$dolibarr_main_db_user); - - if($choix == 1) - { //choix 1=mysql - - $conf = new Conf(); - $conf->db->host = $dolibarr_main_db_host; - $conf->db->name = $dolibarr_main_db_name; - $conf->db->name = $dolibarr_main_db_type; - $conf->db->user = isset($_POST["db_user_root"])?$_POST["db_user_root"]:""; - $conf->db->pass = isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:""; - - //print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->pass; - - $db = new DoliDb(); - - $sql = "INSERT INTO user "; - $sql .= "(Host,User,password,elect_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv)"; - $sql .= " VALUES ('$dolibarr_main_db_host','$dolibarr_main_db_user',password('$dolibarr_main_db_pass')"; - $sql .= ",'Y','Y','Y','Y','Y',Y','Y','Y');"; - - print $sql; - - $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'"; - $sql .= ",'Y','Y','Y','Y','Y','Y','Y','Y');"; - - print $sql; - - if ($db->query($sql)) - { - dolibarr_syslog("flush privileges"); - $db->query("flush privileges"); - - print ""; - } - else - { - if ($db->errno() == 1062) - { - dolibarr_syslog("Utilisateur deja existant"); - print ""; - } - else - { - dolibarr_syslog("impossible de creer l'utilisateur"); - print ""; - } - } - - $db->close(); - } - else - { //choix 2=postgresql - - $nom = $dolibarr_main_db_user; - $con=pg_connect("host=localhost dbname=dolibarr user=postgres"); - $query_str = "create user \"$nom\" with password '".$dolibarr_main_db_pass."';"; - //print $query_str; - $ret = pg_query($con,$query_str); - - if ($ret) - print ""; - else - print ""; - - } - - } - - // Tentative accès serveur et base par le user admin dolibarr - - $conf = new Conf(); - $conf->db->host = $dolibarr_main_db_host; - $conf->db->name = $dolibarr_main_db_name; - $conf->db->user = $dolibarr_main_db_user; - $conf->db->pass = $dolibarr_main_db_pass; - //print $conf->db->host.",".$conf->db->name.",".$conf->db->user.",".$conf->db->pass; - - $db = new DoliDb(); - $ok = 1; - - if ($db->connected == 1) - { - dolibarr_syslog("la connexion au serveur est reussie"); - print ""; - } - else - { - dolibarr_syslog("la connection au serveur est rate"); - print ""; - - print ''; + if (substr($main_dir, strlen($main_dir) -1) == "/") + { + $main_dir = substr($main_dir, 0, strlen($main_dir)-1); + } - $ok = 0; - } - - if ($ok) - { - if($db->database_selected == 1) - { - // - // Connexion base existante - // - dolibarr_syslog("la connexion a la database est reussie"); - print ""; - $ok = 1 ; - } - else - { - // - // Création de la base - // - dolibarr_syslog("la connexion a la database est rate"); - print ""; + if (substr($_POST["main_url"], strlen($_POST["main_url"]) -1) == "/") + { + $_POST["main_url"] = substr($_POST["main_url"], 0, strlen($_POST["main_url"])-1); + } + + clearstatcache(); + + fwrite($fp, ''); + fclose($fp); + + if (file_exists("$conffile")) + { + include ("$conffile"); + print ""; + $error = 0; + } + else + { + $error = 1; + } + } + + if($dolibarr_main_db_type == "mysql") + { + include_once("../lib/mysql.lib.php"); + $choix=1; + } + else + { + include_once("../lib/pgsql.lib.php"); + $choix=2; + } + + + /*************************************************************************** + * + * Creation des répertoires + * + ***************************************************************************/ + + if ($error == 0) + { + + // Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre téléchargés en passant outre l'authentification + $dir[0] = "$main_data_dir/facture"; + $dir[1] = "$main_data_dir/users"; + $dir[2] = "$main_data_dir/propale"; + $dir[3] = "$main_data_dir/societe"; + $dir[4] = "$main_data_dir/ficheinter"; + $dir[5] = "$main_data_dir/produit"; + $dir[6] = "$main_data_dir/rapport"; + $dir[7] = "$main_data_dir/rsscache"; + $dir[8] = "$main_data_dir/logo"; + + if (! is_dir($main_dir)) + { + print ""; + $error++; + } + else + { + dolibarr_syslog ("Le dossier '".$main_dir."' existe"); + + // Répertoire des documents + if (! is_dir($main_data_dir)) + { + @mkdir($main_data_dir, 0755); + } + + if (! is_dir($main_data_dir)) + { + print "'; + $error++; + } + else + { + // Boucle sur chaque répertoire de dir[] pour les créer s'ils nexistent pas + for ($i = 0 ; $i < sizeof($dir) ; $i++) + { + if (is_dir($dir[$i])) + { + dolibarr_syslog ("Le dossier '".$dir[$i]."' existe"); + } + else + { + if (! @mkdir($dir[$i], 0755)) + { + print ""; + $error++; + } + else + { + dolibarr_syslog ("Le dossier '".$dir[$i]."' a ete cree"); + } + } + } + } + } + } + + + /* + * Base de données + * + */ + + if ($error == 0) + { + include_once($dolibarr_main_document_root . "/conf/conf.class.php"); + + $conf = new Conf(); + $conf->db->type = trim($dolibarr_main_db_type); + $conf->db->host = trim($dolibarr_main_db_host); + $conf->db->name = trim($dolibarr_main_db_name); + $conf->db->user = trim($dolibarr_main_db_user); + $conf->db->pass = trim($dolibarr_main_db_pass); + + $userroot=isset($_POST["db_user_root"])?$_POST["db_user_root"]:""; + $passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:""; + + $ok=0; + + + /* + * Si creation utilisateur admin demandée, on le crée + */ + if (isset($_POST["db_create_user"]) && $_POST["db_create_user"] == "on") + { + dolibarr_syslog ("Creation de l'utilisateur : ".$dolibarr_main_db_user); + + if ($choix == 1) //choix 1=mysql + { + //print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->pass; + $db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,'mysql'); + + if ($db->connected) + { + $sql = "INSERT INTO user "; + $sql .= "(Host,User,password,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_user',password('$dolibarr_main_db_pass')"; + $sql .= ",'Y','Y','Y','Y','Y','Y','Y','Y');"; + + //print "$sql
\n"; + + $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'"; + $sql .= ",'Y','Y','Y','Y','Y','Y','Y','Y');"; + + //print "$sql
\n"; + + if ($db->query($sql)) + { + dolibarr_syslog("flush privileges"); + $db->query("FLUSH Privileges;"); + + print ''; + print ''; + } + else + { + if ($db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS) + { + dolibarr_syslog("Utilisateur deja existant"); + print ''; + print ""; + } + else + { + dolibarr_syslog("impossible de creer l'utilisateur"); + print ''; + print ""; + } + } + + $db->close(); + } + else { + print ''; + print ''; + print ''; + + // Affiche aide diagnostique + print ''; + + $ok=-1; + } + } + else //choix 2=postgresql + { + $nom = $dolibarr_main_db_user; + $con=pg_connect("host=localhost dbname=dolibarr user=postgres"); + $query_str = "create user \"$nom\" with password '".$dolibarr_main_db_pass."';"; + //print $query_str; + $ret = pg_query($con,$query_str); + + if ($ret) + { + print ''; + print ''; + print ''; + } + else + { + print ''; + print ''; + print ''; + } + } + + } // Fin si "creation utilisateur" + + + /* + * Si creation database demandée, on la crée + */ + if (isset($_POST["db_create_database"]) && $_POST["db_create_database"] == "on") + { + dolibarr_syslog ("Creation de la base : ".$dolibarr_main_db_name); + + $db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,$conf->db->name); + + if ($db->connected) + { + if ($db->create_db($dolibarr_main_db_pass)) + { + print ''; + print ""; + } + else + { + print ''; + print ""; + + // Affiche aide diagnostique + print ''; + + $ok=-1; + } + $db->close(); + } + else { + print ''; + print ''; + print ''; + + // Affiche aide diagnostique + print ''; + + $ok=-1; + } + } // Fin si "creation database" + + + /* + * On essaie l'accès par le user admin dolibarr + */ + if ($ok == 0) + { + + $db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name); + + if ($db->connected == 1) + { + // si accès serveur ok et accès base ok, tout est ok, on ne va pas plus loin, on a même pas utilisé le compte root. + if ($db->database_selected == 1) + { + dolibarr_syslog("la connexion au serveur par le user dolibarr est reussie"); + print ""; + + dolibarr_syslog("la connexion a la database par le user dolibarr est reussie"); + print ""; + + $ok = 1; + } + else + { + dolibarr_syslog("la connection au serveur par le user dolibarr est reussie"); + print ""; + + dolibarr_syslog("la connexion a la database par le user dolibarr a échoué"); + print ""; + + // Affiche aide diagnostique + print ''; + + $ok = -1; + } + } + else { + dolibarr_syslog("la connection au serveur par le user dolibarr est rate"); + print ""; + + // Affiche aide diagnostique + print ''; + + $ok = -1; + } + } - print ''; - - $conf = new Conf(); - $conf->db->host = $dolibarr_main_db_host; - $conf->db->name = $dolibarr_main_db_name; - $conf->db->user = isset($_POST["db_user_root"])?$_POST["db_user_root"]:""; - $conf->db->pass = isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:""; - - $dbt = new DoliDb(); // Ne pas prendre $db comme nom de variable car dejà pris pour connexion précédente et bug mémoire sur php windows dans ce cas - - if ($ok) - { - if ($dbt->connected == 1) - { - dolibarr_syslog("la connexion au serveur avec l'utilisateur root reussi"); - print ""; - } - else - { - dolibarr_syslog("la connexion au serveur avec l'utilisateur root rate"); - if (! $conf->db->user) { - print ""; - } else { - print ""; - } - $ok = 0; - } - } - - - if ($ok) - { - if ($dbt->create_db ($dolibarr_main_db_name)) - { - print ""; - } - else - { - print ""; - $ok = 0; - } - } - } - } } } + ?>
Création de l'utilisateur : $dolibarr_main_db_userOK
Création de l'utilisateur : $dolibarr_main_db_userDeja existant
Création de l'utilisateur : $dolibarr_main_db_userERREUR ".$db->error()."
Création de l'utilisateur:\"$nom\"OK
Création de l'utilisateur:\"$nom\"ERREUR
"; - print $langs->trans("ServerConnection")." : "; - print $dolibarr_main_db_host; - print ""; - print $langs->trans("OK"); - print "
"; - print $langs->trans("ServerConnection")." : "; - print $dolibarr_main_db_host; - print ""; - print $langs->trans("Error"); - print "
Un des paramètres saisis est peut-être incorrect:
'; - print 'host='.$conf->db->host.', name='.$conf->db->name.', user='.$conf->db->user.', pass='.$conf->db->pass.'
'; - print 'Revenez en arrière pour corriger les paramètres.'; - print '
"; - print $langs->trans("DatabaseConnection")." : "; - print $dolibarr_main_db_name; - print ""; - print $langs->trans("OK"); - print "
"; - print "Echec de connexion à la base : "; - print $dolibarr_main_db_name; - print ""; - print $langs->trans("Warning"); - print "
".$langs->trans("ConfigurationSaving")."".$langs->trans("OK")."
"; + print $langs->trans("DirDoesNotExists",$main_dir); + print ""; + print $langs->trans("Error"); + print "
Le dossier '$main_data_dir' n'existe pas ! "; + print "Vous devez créer ce dossier et permettre au serveur web d'écrire dans celui-ci"; + print 'Erreur
"; + print "Impossible de créer : ".$dir[$i]; + print ""; + print $langs->trans("Error"); + print "
'; + print $langs->trans("UserCreation").' : '; + print $dolibarr_main_db_user; + print ''.$langs->trans("OK").'
'; + print $langs->trans("UserCreation").' : '; + print $dolibarr_main_db_user; + print 'Deja existant
'; + print $langs->trans("UserCreation").' : '; + print $dolibarr_main_db_user; + print '".$langs->trans("Error").' '.$db->error()."
'; + print $langs->trans("UserCreation").' : '; + print $dolibarr_main_db_user; + print ''.$langs->trans("Error").'

Vous avez demandé la création du login Dolibarr ('.$dolibarr_main_db_user.') mais pour cela '; + print 'Dolibarr doit se connecter sur le serveur ('.$dolibarr_main_db_host.') via le super utilisateur ('.$userroot.'), mot de passe ('.$passroot.'). '; + print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects.
'; + print 'Revenez en arrière pour corriger les paramètres.
'; + print '
'; + print $langs->trans("UserCreation").' : '; + print $dolibarr_main_db_user; + print ''.$langs->trans("OK").'
'; + print $langs->trans("UserCreation").' : '; + print $dolibarr_main_db_user; + print ''.$langs->trans("Error").'
'; + print $langs->trans("DatabaseCreation").' : '; + print $dolibarr_main_db_name; + print '".$langs->trans("OK")."
'; + print $langs->trans("DatabaseCreation").' : '; + print $dolibarr_main_db_name; + print '".$langs->trans("Error")."

La création de la base Dolibarr ('.$dolibarr_main_db_name.') a échoué.'; + print 'Si la base existe déjà, revenez en arrière et désactiver l\'option "Créer la base de donnée".
'; + print '
'; + print $langs->trans("DatabaseCreation").' : '; + print $dolibarr_main_db_name; + print ''.$langs->trans("Error").'

Vous avez demandé la création de la base Dolibarr ('.$dolibarr_main_db_name.') mais pour cela '; + print 'Dolibarr doit se connecter sur le serveur ('.$dolibarr_main_db_host.') via le super utilisateur ('.$userroot.'), mot de passe ('.$passroot.'). '; + print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects.
'; + print 'Revenez en arrière pour corriger les paramètres.
'; + print '
"; + print $langs->trans("ServerConnection")." : "; + print $dolibarr_main_db_host; + print ""; + print $langs->trans("OK"); + print "
"; + print $langs->trans("DatabaseConnection")." : "; + print $dolibarr_main_db_name; + print ""; + print $langs->trans("OK"); + print "
"; + print $langs->trans("ServerConnection")." : "; + print $dolibarr_main_db_host; + print ""; + print $langs->trans("OK"); + print "
"; + print $langs->trans("DatabaseConnection")." : "; + print $dolibarr_main_db_name; + print ""; + print $langs->trans("Error"); + print "

Vérifier que le nom de base ('.$dolibarr_main_db_name.') est correct. '; + print 'Si ce nom est correct et que cette base n\'existe pas déjà, vous devez cocher l\'option "Créer la base de donnée".
'; + print 'Revenez en arrière pour corriger les paramètres.
'; + print '
"; + print $langs->trans("ServerConnection")." : "; + print $dolibarr_main_db_host; + print ""; + print $langs->trans("Error"); + print "

Le serveur ('.$conf->db->host.'), nom de base ('.$conf->db->name.'), login ('.$conf->db->user.'), ou mot de passe ('.$conf->db->pass.') de la base de donnée est peut-être incorrect.
'; + print 'Si le login n\'existe pas encore, vous devez cocher l\'option "Créer l\'utilisateur".
'; + print 'Revenez en arrière pour corriger les paramètres.
'; + print '
'; - print "On tente de créer la base : "; - print $dolibarr_main_db_name; - print '
Connexion au serveur : $dolibarr_main_db_host, avec l'utilisateur : ".$_POST["db_user_root"]."".$langs->trans("OK")."
".$langs->trans("Error").": "; - print "Le super utilisateur de la base est requis pour créer la base."; - print "Créer la base en manuel ou revenez en arrière pour saisir le super utilisateur"; - print "
Connexion au serveur : $dolibarr_main_db_host avec l'utilisateur : ".$_POST["db_user_root"]."".$langs->trans("Error")."
Création de la base : $dolibarr_main_db_name".$langs->trans("OK")."
Création de la base : $dolibarr_main_db_name".$langs->trans("Error")."
diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index 37f07f9bef2..4dd46dac692 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -59,11 +59,13 @@ if ($_POST["action"] == "set") $error=0; $conf = new Conf();// on pourrait s'en passer + $conf->db->type = $dolibarr_main_db_type; $conf->db->host = $dolibarr_main_db_host; $conf->db->name = $dolibarr_main_db_name; $conf->db->user = $dolibarr_main_db_user; $conf->db->pass = $dolibarr_main_db_pass; - $db = new DoliDb(); + + $db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name); $ok = 0; if ($db->connected == 1) { diff --git a/htdocs/install/etape4.php b/htdocs/install/etape4.php index 9d7d31f5b15..e91a2bbabb3 100644 --- a/htdocs/install/etape4.php +++ b/htdocs/install/etape4.php @@ -49,11 +49,13 @@ print ''; $error=0; $conf = new Conf(); +$conf->db->type = $dolibarr_main_db_type; $conf->db->host = $dolibarr_main_db_host; $conf->db->name = $dolibarr_main_db_name; $conf->db->user = $dolibarr_main_db_user; $conf->db->pass = $dolibarr_main_db_pass; -$db = new DoliDb(); + +$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name); $ok = 0; if ($db->ok == 1) { diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 09ad3c8af7a..c6658da0d8b 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -74,11 +74,13 @@ if ($_POST["action"] == "set") $error=0; $conf = new Conf(); + $conf->db->type = $dolibarr_main_db_type; $conf->db->host = $dolibarr_main_db_host; $conf->db->name = $dolibarr_main_db_name; $conf->db->user = $dolibarr_main_db_user; $conf->db->pass = $dolibarr_main_db_pass; - $db = new DoliDb(); + + $db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name); $ok = 0; if ($db->connected == 1) { diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index cfb245d1bb5..957afa0e5d3 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -24,7 +24,8 @@ * */ -/** \file htdocs/install/fileconf.php +/** + \file htdocs/install/fileconf.php \ingroup install \brief Demande les infos qui constituerons le contenu du fichier conf.php. Ce fichier sera remplie à l'étape suivante \version $Revision$ @@ -154,7 +155,7 @@ $dolibarr_main_db_host = "localhost"; + + + + + + + @@ -221,7 +233,7 @@ Nom de la base de donn diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 4f053268250..ecff4dfcf92 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -95,13 +95,13 @@ function pFooter($nonext=0,$addlang=1) function dolibarr_syslog($message) { - define_syslog_variables(); - - openlog("dolibarr", LOG_PID | LOG_PERROR, LOG_USER); # LOG_USER au lieu de LOG_LOCAL0 car non accepté par tous les php - - syslog(LOG_WARNING, $message); - - closelog(); +// \todo Désactiver sous Windows (gros problème mémoire et faute de protections) +// if (1 == 2) { + define_syslog_variables(); + openlog("dolibarr", LOG_PID | LOG_PERROR, LOG_USER); # LOG_USER au lieu de LOG_LOCAL0 car non accepté par tous les php + syslog(LOG_WARNING, $message); + closelog(); +// } } ?>
-trans("DatabaseChoice"); ?> +trans("DatabaseType"); ?> -Nom de la base de données Dolibarr (sera créée si nécessaire) +trans("DatabaseName"); ?> +
+trans("CreateDatabase"); ?> + +trans("CheckToCreateDatabase"); ?>
-trans("CheckToCreate"); ?> +trans("CheckToCreateUser"); ?>