-
Installation de Dolibarr - Etape 1/5
-
Installation de Dolibarr - Etape $etape/$etapes";
$conf = "../conf/conf.php";
@@ -63,67 +64,119 @@ if ($HTTP_POST_VARS["action"] == "set")
if (file_exists("$conf"))
{
include ("$conf");
- }
- print "
Configuration enregistrée OK ";
- print 'Test des répertoires ';
+ print "
Configuration enregistrée OK ";
- if (! is_dir($HTTP_POST_VARS["main_dir"]))
- {
- print "Le dossier ".$HTTP_POST_VARS["main_dir"]." n'existe pas ! Erreur ";
- $error++;
- }
- else
- {
-
- print "
Le dossier ".$HTTP_POST_VARS["main_dir"]." existe OK ";
- /*
- * Répertoire des documents
- */
- if (! is_dir($HTTP_POST_VARS["main_dir"]."/document"))
+ print '
Test des répertoires ';
+
+ if (! is_dir($HTTP_POST_VARS["main_dir"]))
{
- @mkdir($HTTP_POST_VARS["main_dir"]."/document", 0755);
- }
-
-
- if (! is_dir($HTTP_POST_VARS["main_dir"]."/document"))
- {
- print "
Le dossier ".$HTTP_POST_VARS["main_dir"]."/document n'existe pas !";
- print "- Vous devez créer le dossier : ".$HTTP_POST_VARS["main_dir"]."/document et permettre au serveur web d'écrire dans celui-ci";
- print '
Erreur ';
+ print "
Le dossier ".$HTTP_POST_VARS["main_dir"]." n'existe pas ! Erreur ";
$error++;
}
else
{
- $dir[0] = $HTTP_POST_VARS["main_dir"]."/document/facture";
- $dir[1] = $HTTP_POST_VARS["main_dir"]."/document/propale";
- $dir[2] = $HTTP_POST_VARS["main_dir"]."/document/societe";
- $dir[3] = $HTTP_POST_VARS["main_dir"]."/document/ficheinter";
- $dir[4] = $HTTP_POST_VARS["main_dir"]."/document/produit";
-
- for ($i = 0 ; $i < sizeof($dir) ; $i++)
+
+ print "
Le dossier ".$HTTP_POST_VARS["main_dir"]." existe OK ";
+ /*
+ * Répertoire des documents
+ */
+ if (! is_dir($HTTP_POST_VARS["main_dir"]."/document"))
{
- if (is_dir($dir[$i]))
+ @mkdir($HTTP_POST_VARS["main_dir"]."/document", 0755);
+ }
+
+
+ if (! is_dir($HTTP_POST_VARS["main_dir"]."/document"))
+ {
+ print "
Le dossier ".$HTTP_POST_VARS["main_dir"]."/document n'existe pas !";
+ print "- Vous devez créer le dossier : ".$HTTP_POST_VARS["main_dir"]."/document et permettre au serveur web d'écrire dans celui-ci";
+ print '
Erreur ';
+ $error++;
+ }
+ else
+ {
+ $dir[0] = $HTTP_POST_VARS["main_dir"]."/document/facture";
+ $dir[1] = $HTTP_POST_VARS["main_dir"]."/document/propale";
+ $dir[2] = $HTTP_POST_VARS["main_dir"]."/document/societe";
+ $dir[3] = $HTTP_POST_VARS["main_dir"]."/document/ficheinter";
+ $dir[4] = $HTTP_POST_VARS["main_dir"]."/document/produit";
+
+ for ($i = 0 ; $i < sizeof($dir) ; $i++)
{
- print "
Le dossier ".$dir[$i]." existe OK ";
- }
- else
- {
- if (! @mkdir($dir[$i], 0755))
+ if (is_dir($dir[$i]))
{
- print "
Impossible de créer : ".$dir[$i]." Erreur ";
- $error++;
+ print "
Le dossier ".$dir[$i]." existe OK ";
}
else
{
- print "
Création de : ".$dir[$i]." réussie OK ";
+ if (! @mkdir($dir[$i], 0755))
+ {
+ print "
Impossible de créer : ".$dir[$i]." Erreur ";
+ $error++;
+ }
+ else
+ {
+ print "
Création de : ".$dir[$i]." réussie OK ";
+ }
}
}
}
}
- }
+
+ /*
+ * Base de données
+ *
+ */
+ require ($dolibarr_main_document_root . "/lib/mysql.lib.php");
+ require ($dolibarr_main_document_root . "/conf/conf.class.php");
+
+ $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;
+ $db = new DoliDb();
+ $ok = 0;
+ if ($db->connected == 1)
+ {
+ print "
Connexion réussie au serveur : $dolibarr_main_db_host OK ";
+
+ if($db->database_selected == 1)
+ {
+ //
+ // Connexion base existante
+ //
+ print "
Connexion réussie à la base : $dolibarr_main_db_name OK ";
+
+ $ok = 1 ;
+ }
+ else
+ {
+ //
+ // Création de la base
+ //
+
+ print "
Echec de connexion à la base : $dolibarr_main_db_name Warning ";
+
+ $ok = 0;
+
+ print "
Création de la base : $dolibarr_main_db_name - ";
+
+ if ($db->create_db ($dolibarr_main_db_name))
+ {
+ print "
Création de la base réussie : $dolibarr_main_db_name OK ";
+ $db->select_db ($dolibarr_main_db_name);
+ }
+ else
+ {
+ print "
Echec de création de la base : $dolibarr_main_db_name ERREUR ";
+ }
+ }
+ }
+ }
}
else
{
diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php
index 0717683648b..f8ca0519d0e 100644
--- a/htdocs/install/etape2.php
+++ b/htdocs/install/etape2.php
@@ -7,9 +7,11 @@
-
Installation de Dolibarr - Etape 2/5
-
Installation de Dolibarr - Etape $etape/$etapes";
+
$conf = "../conf/conf.php";
if (file_exists($conf))
{
@@ -65,11 +67,10 @@ if ($HTTP_POST_VARS["action"] == "set")
while (($file = readdir($handle))!==false)
{
- if (substr($file, strlen($file) - 4) == '.sql' && substr($file,0,4) == 'llx_')
+ if (substr($file, strlen($file) - 4) == '.sql' &&
+ substr($file,0,4) == 'llx_')
{
$name = substr($file, 0, strlen($file) - 4);
- $classname = substr($file, 0, strlen($file) -12);
-
print "
Création de la table $name ";
$buffer = '';
$fp = fopen($dir.$file,"r");
@@ -92,6 +93,7 @@ if ($HTTP_POST_VARS["action"] == "set")
$error++;
}
}
+
}
closedir($handle);
}
@@ -110,7 +112,7 @@ if ($HTTP_POST_VARS["action"] == "set")
-
diff --git a/htdocs/install/etape3.php b/htdocs/install/etape3.php
index 82d6d94c2d0..3891d41acd3 100644
--- a/htdocs/install/etape3.php
+++ b/htdocs/install/etape3.php
@@ -7,9 +7,12 @@
-
Installation de Dolibarr - Etape 3/5
Installation de Dolibarr - Etape $etape/$etapes";
+
$conf = "../conf/conf.php";
if (file_exists($conf))
{
@@ -93,7 +96,7 @@ if ($HTTP_POST_VARS["action"] == "set")
-
diff --git a/htdocs/install/etape4.php b/htdocs/install/etape4.php
index d9f19c9af50..6adfbe4ef58 100644
--- a/htdocs/install/etape4.php
+++ b/htdocs/install/etape4.php
@@ -7,9 +7,12 @@
-
Installation de Dolibarr - Etape 4/5
Installation de Dolibarr - Etape $etape/$etapes";
+
$conf = "../conf/conf.php";
if (file_exists($conf))
{
diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php
index 5ca11a65cd1..8eb55b4e02b 100644
--- a/htdocs/install/etape5.php
+++ b/htdocs/install/etape5.php
@@ -7,9 +7,12 @@
-
Installation de Dolibarr - Etape 5/5
Installation de Dolibarr - Etape $etape/$etapes";
+
$conf = "../conf/conf.php";
if (file_exists($conf))
{
diff --git a/htdocs/install/index.php b/htdocs/install/index.php
index 73cbac81b7f..8c94c7f803b 100644
--- a/htdocs/install/index.php
+++ b/htdocs/install/index.php
@@ -103,8 +103,9 @@ exemples :
+
-Base de données
+Base de données
@@ -129,10 +130,30 @@ exemples :
Mot de passe
-
+
+
Base de données - Accés super utilisateur
+
+
+Login
+
+
+
+
+
+
+
+Mot de passe
+
+
+
+
+
+
+
+