Fin pour moi, pour l'instant
This commit is contained in:
parent
396bf83e2d
commit
945d1134c8
@ -60,7 +60,7 @@ div.soustitre {
|
||||
div.main {
|
||||
background: #dcdcd3;
|
||||
text-align: left;
|
||||
border: 1px solid #8CACBB;
|
||||
border: 1px solid #8CACBB;
|
||||
}
|
||||
|
||||
div.main-inside {
|
||||
@ -71,6 +71,15 @@ div.main-inside {
|
||||
}
|
||||
|
||||
|
||||
div.error {
|
||||
font-size: 1.3em;
|
||||
padding: 10px;
|
||||
margin-top: 10px;
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
|
||||
|
||||
div.barrebottom {
|
||||
text-align: right;
|
||||
margin-top: 10px;
|
||||
|
||||
@ -20,20 +20,10 @@
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="./default.css">
|
||||
<title>Dolibarr Install</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="main-inside">
|
||||
<?PHP
|
||||
include("./inc.php");
|
||||
pHeader("Fichier de configuration","etape4");
|
||||
|
||||
$etape = 2;
|
||||
print "<h2>Installation de Dolibarr - Etape $etape/$etapes</h2>";
|
||||
|
||||
$conf = "../conf/conf.php";
|
||||
if (file_exists($conf))
|
||||
@ -45,7 +35,6 @@ require ($dolibarr_main_document_root . "/conf/conf.class.php");
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == "set")
|
||||
{
|
||||
umask(0);
|
||||
print '<h2>Base de donnée</h2>';
|
||||
|
||||
print '<table cellspacing="0" cellpadding="4" border="0" width="100%">';
|
||||
@ -63,127 +52,206 @@ if ($HTTP_POST_VARS["action"] == "set")
|
||||
if ($db->connected == 1)
|
||||
{
|
||||
print "<tr><td>Connexion réussie au serveur : $dolibarr_main_db_host</td><td>OK</td></tr>";
|
||||
|
||||
$ok = 1 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td>Erreur lors de la création de : $dolibarr_main_db_name</td><td>ERREUR</td></tr>";
|
||||
}
|
||||
/***************************************************************************************
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($ok)
|
||||
{
|
||||
if($db->database_selected == 1)
|
||||
{
|
||||
print "<tr><td>Connexion réussie à la base : $dolibarr_main_db_name</td><td>OK</td></tr>";
|
||||
|
||||
$ok = 1 ;
|
||||
|
||||
//$result = $db->list_tables($dolibarr_main_db_name);
|
||||
//if ($result)
|
||||
//{
|
||||
// while ($row = $db->fetch_row())
|
||||
// {
|
||||
// print "Table : $row[0]<br>\n";
|
||||
// }
|
||||
//}
|
||||
|
||||
// Création des tables
|
||||
$dir = "../../mysql/tables/";
|
||||
|
||||
$handle=opendir($dir);
|
||||
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, strlen($file) - 4) == '.sql' &&
|
||||
substr($file,0,4) == 'llx_')
|
||||
{
|
||||
$name = substr($file, 0, strlen($file) - 4);
|
||||
print "<tr><td>Création de la table $name</td>";
|
||||
$buffer = '';
|
||||
$fp = fopen($dir.$file,"r");
|
||||
if ($fp)
|
||||
{
|
||||
while (!feof ($fp))
|
||||
{
|
||||
$buffer .= fgets($fp, 4096);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if ($db->query($buffer))
|
||||
{
|
||||
print "<td>OK</td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($db->errno() == 1050) {
|
||||
print "<td>Déjà existante</td></tr>";
|
||||
}
|
||||
else {
|
||||
print "<td>ERREUR ".$db->errno()."</td></tr>";
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
//
|
||||
// Données
|
||||
//
|
||||
$dir = "../../mysql/data/";
|
||||
$file = "data.sql";
|
||||
|
||||
$fp = fopen($dir.$file,"r");
|
||||
if ($fp)
|
||||
{
|
||||
while (!feof ($fp))
|
||||
{
|
||||
$buffer = fgets($fp, 4096);
|
||||
|
||||
if (strlen(trim(ereg_replace("--","",$buffer))))
|
||||
{
|
||||
if ($db->query($buffer))
|
||||
{
|
||||
$ok = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ok = 0;
|
||||
if ($db->errno() == 1062) {
|
||||
// print "<tr><td>Insertion ligne : $buffer</td><td>Déja existante</td></tr>";
|
||||
}
|
||||
else {
|
||||
print "Erreur SQL ".$db->errno()." sur requete '$buffer'<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
print "<tr><td>Chargement des données de base</td>";
|
||||
if ($ok)
|
||||
{
|
||||
print "<td>OK</td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ok = 1 ;
|
||||
}
|
||||
|
||||
dolibarr_syslog("Connexion réussie à la base : $dolibarr_main_db_name");
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td>Erreur lors de la création de : $dolibarr_main_db_name</td><td>ERREUR</td></tr>";
|
||||
$ok = 0 ;
|
||||
}
|
||||
|
||||
}
|
||||
/***************************************************************************************
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($ok)
|
||||
{
|
||||
$ok = 0;
|
||||
//$result = $db->list_tables($dolibarr_main_db_name);
|
||||
//if ($result)
|
||||
//{
|
||||
// while ($row = $db->fetch_row())
|
||||
// {
|
||||
// print "Table : $row[0]<br>\n";
|
||||
// }
|
||||
//}
|
||||
|
||||
// Création des tables
|
||||
$dir = "../../mysql/tables/";
|
||||
|
||||
$handle=opendir($dir);
|
||||
$table_exists = 0;
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, strlen($file) - 4) == '.sql' && substr($file,0,4) == 'llx_')
|
||||
{
|
||||
$name = substr($file, 0, strlen($file) - 4);
|
||||
//print "<tr><td>Création de la table $name</td>";
|
||||
$buffer = '';
|
||||
$fp = fopen($dir.$file,"r");
|
||||
if ($fp)
|
||||
{
|
||||
while (!feof ($fp))
|
||||
{
|
||||
$buffer .= fgets($fp, 4096);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if ($db->query($buffer))
|
||||
{
|
||||
print "<td>OK</td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($db->errno() == 1050)
|
||||
{
|
||||
//print "<td>Déjà existante</td></tr>";
|
||||
$table_exists = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td>Création de la table $name</td>";
|
||||
print "<td>ERREUR ".$db->errno()."</td></tr>";
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
if ($error == 0)
|
||||
{
|
||||
print '<tr><td colspan="2">Création des tables réussie</td></tr>';
|
||||
$ok = 1;
|
||||
}
|
||||
}
|
||||
/***************************************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
***************************************************************************************/
|
||||
if ($ok == 1)
|
||||
{
|
||||
//
|
||||
// Données
|
||||
//
|
||||
$dir = "../../mysql/data/";
|
||||
$file = "data.sql";
|
||||
|
||||
$fp = fopen($dir.$file,"r");
|
||||
if ($fp)
|
||||
{
|
||||
while (!feof ($fp))
|
||||
{
|
||||
$buffer = fgets($fp, 4096);
|
||||
|
||||
if (strlen(trim(ereg_replace("--","",$buffer))))
|
||||
{
|
||||
if ($db->query($buffer))
|
||||
{
|
||||
$ok = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ok = 0;
|
||||
if ($db->errno() == 1062)
|
||||
{
|
||||
// print "<tr><td>Insertion ligne : $buffer</td><td>Déja existante</td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Erreur SQL ".$db->errno()." sur requete '$buffer'<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
print "<tr><td>Chargement des données de base</td>";
|
||||
if ($ok)
|
||||
{
|
||||
print "<td>OK</td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ok = 1 ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
***************************************************************************************/
|
||||
if ($ok == 1)
|
||||
{
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
$sql[0] = "REPLACE INTO llx_const SET name = 'FAC_OUTPUTDIR', value='".$dolibarr_main_document_root."/document/facture', visible=0, type='chaine'";
|
||||
|
||||
$sql[1] = "REPLACE INTO llx_const SET name = 'FAC_OUTPUT_URL', value='".$dolibarr_main_url_root."/document/facture', visible=0, type='chaine'";
|
||||
|
||||
$sql[2] = "REPLACE INTO llx_const SET name = 'PROPALE_OUTPUTDIR', value='".$dolibarr_main_document_root."/document/propale', visible=0, type='chaine'";
|
||||
|
||||
$sql[3] = "REPLACE INTO llx_const SET name = 'PROPALE_OUTPUT_URL', value='".$dolibarr_main_url_root."/document/propale', visible=0, type='chaine'";
|
||||
|
||||
$sql[4] = "REPLACE INTO llx_const SET name = 'FICHEINTER_OUTPUTDIR', value='".$dolibarr_main_document_root."/document/ficheinter', visible=0, type='chaine'";
|
||||
|
||||
$sql[5] = "REPLACE INTO llx_const SET name = 'FICHEINTER_OUTPUT_URL', value='".$dolibarr_main_url_root."/document/ficheinter', visible=0, type='chaine'";
|
||||
|
||||
$sql[6] = "REPLACE INTO llx_const SET name = 'SOCIETE_OUTPUTDIR', value='".$dolibarr_main_document_root."/document/societe', visible=0, type='chaine'";
|
||||
|
||||
$sql[7] = "REPLACE INTO llx_const SET name = 'SOCIETE_OUTPUT_URL', value='".$dolibarr_main_url_root."/document/societe', visible=0, type='chaine'";
|
||||
$result = 0;
|
||||
|
||||
for ($i=0; $i < sizeof($sql);$i++)
|
||||
{
|
||||
if ($db->query($sql[$i]))
|
||||
{
|
||||
$result++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($result == sizeof($sql))
|
||||
{
|
||||
if ($error == 0)
|
||||
{
|
||||
$db->query("DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED'");
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
***************************************************************************************/
|
||||
|
||||
print '</table>';
|
||||
|
||||
$db->close();
|
||||
}
|
||||
pFooter(!$ok);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="barrebottom">
|
||||
<form action="etape3.php" method="POST">
|
||||
<input type="hidden" name="action" value="set">
|
||||
<input type="submit" value="Etape suivante ->">
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1,18 +1,26 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="./default.css">
|
||||
<title>Dolibarr Install</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="main-inside">
|
||||
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
include("./inc.php");
|
||||
$etape = 4;
|
||||
print "<h2>Installation de Dolibarr - Etape $etape/$etapes</h2>";
|
||||
|
||||
pHeader("Création du compte administrateur","etape5");
|
||||
$conf = "../conf/conf.php";
|
||||
if (file_exists($conf))
|
||||
{
|
||||
@ -21,43 +29,44 @@ if (file_exists($conf))
|
||||
require ($dolibarr_main_document_root . "/lib/mysql.lib.php");
|
||||
require ($dolibarr_main_document_root . "/conf/conf.class.php");
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == "set")
|
||||
print '<table cellspacing="0" cellpadding="4" border="1" width="100%">';
|
||||
|
||||
$error=0;
|
||||
|
||||
$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->ok == 1)
|
||||
{
|
||||
umask(0);
|
||||
print '<h2>Création du compte admin</h2>';
|
||||
print '<form action="etape5.php" method="POST">';
|
||||
print '<table cellspacing="0" cellpadding="4" border="1" width="100%">';
|
||||
|
||||
print '<tr><td>Compte administrateur :</td><td>';
|
||||
print '<input name="login"></td></tr>';
|
||||
print '<tr><td>Mot de passe :</td><td>';
|
||||
print '<input type="password" name="pass"></td></tr>';
|
||||
print '<tr><td>Vérification du mot de passe :</td><td>';
|
||||
print '<input type="password" name="pass_verif"></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
$error=0;
|
||||
|
||||
$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->ok == 1)
|
||||
if ($_GET["error"] == 1)
|
||||
{
|
||||
|
||||
print '<tr><td>Compte administrateur :</td><td>';
|
||||
print '<input name="login"></td></tr>';
|
||||
print '<tr><td>Mot de passe :</td><td>';
|
||||
print '<input type="password" name="pass"></td></tr>';
|
||||
print '<tr><td>Vérification du mot de passe :</td><td>';
|
||||
print '<input type="password" name="pass_verif"></td></tr>';
|
||||
print '</table>';
|
||||
$db->close();
|
||||
print '<div class="error">Les mots de passe ne concordent pas, veuillez recommencer !</div>';
|
||||
}
|
||||
|
||||
if ($_GET["error"] == 2)
|
||||
{
|
||||
print '<div class="error">Veuillez saisir un mot de passe, les mots de passe vides ne sont pas acceptés !</div>';
|
||||
}
|
||||
|
||||
if ($_GET["error"] == 3)
|
||||
{
|
||||
print '<div class="error">Veuillez saisir un login !</div>';
|
||||
}
|
||||
$db->close();
|
||||
}
|
||||
|
||||
pFooter($err);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="barrebottom">
|
||||
<input type="hidden" name="action" value="set">
|
||||
<input type="submit" value="Etape suivante ->">
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -20,22 +20,7 @@
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="./default.css">
|
||||
<title>Dolibarr Install</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="main-inside">
|
||||
|
||||
<?PHP
|
||||
include("./inc.php");
|
||||
$etape = 5;
|
||||
print "<h2>Installation de Dolibarr - Etape $etape/$etapes</h2>";
|
||||
|
||||
$success=0;
|
||||
|
||||
$conf = "../conf/conf.php";
|
||||
@ -48,8 +33,23 @@ require ($dolibarr_main_document_root . "/conf/conf.class.php");
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == "set")
|
||||
{
|
||||
umask(0);
|
||||
print '<h2>Base de donnée</h2>';
|
||||
if ($HTTP_POST_VARS["pass"] <> $HTTP_POST_VARS["pass_verif"])
|
||||
{
|
||||
Header("Location: etape4.php?error=1");
|
||||
}
|
||||
|
||||
if (strlen(trim($HTTP_POST_VARS["pass"])) == 0)
|
||||
{
|
||||
Header("Location: etape4.php?error=2");
|
||||
}
|
||||
|
||||
if (strlen(trim($HTTP_POST_VARS["login"])) == 0)
|
||||
{
|
||||
Header("Location: etape4.php?error=3");
|
||||
}
|
||||
|
||||
|
||||
pHeader("Fin de l'installation","etape5");
|
||||
|
||||
print '<table cellspacing="0" cellpadding="4" border="1" width="100%">';
|
||||
$error=0;
|
||||
@ -87,22 +87,9 @@ if ($HTTP_POST_VARS["action"] == "set")
|
||||
?>
|
||||
<br>
|
||||
|
||||
<div class="main">
|
||||
<div class="main-inside">
|
||||
<?PHP
|
||||
print "Votre système est maintenant configuré, il ne vous reste plus qu'a sélectionner les modules que vous souhaitez utiliser. Pour cela cliquer sur l'url ci-dessous : <br>";
|
||||
print '<a href="'.$dolibarr_main_url_root .'/admin/modules.php">Configurer les modules</a>';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?PHP
|
||||
if ($success == 1)
|
||||
{
|
||||
|
||||
}
|
||||
pFooter(1);
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user