Fix: Corrections nombreux petits bugs de l'install.

This commit is contained in:
Laurent Destailleur 2007-04-18 17:38:55 +00:00
parent 750f3a9387
commit e7c04eee42
7 changed files with 49 additions and 25 deletions

View File

@ -52,19 +52,22 @@ print "<br>\n";
print $langs->trans("InstallEasy")."<br><br>\n"; print $langs->trans("InstallEasy")."<br><br>\n";
print '<b>'.$langs->trans("MiscellanousChecks")."</b>:<br>\n"; print '<b>'.$langs->trans("MiscellanousChecks")."</b>:<br>\n";
// Check PHP version // Check PHP version
if (versioncompare(versionphp(),array(4,1)) < 0) if (versioncompare(versionphp(),array(4,1)) < 0)
{ {
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow",'4.1')."<br>\n"; print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow",'4.1');
$checksok=0; $checksok=0;
} }
else else
{ {
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPVersion")." ".versiontostring(versionphp())."<br>\n"; print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPVersion")." ".versiontostring(versionphp());
} }
print ' (<a href="phpinfo.php" target="_info">'.$langs->trans("MoreInformation").'</a>)';
print "<br>\n";
// Check PHP support for $_POST // Check PHP support for $_POST
if (! isset($_GET["testget"]) && ! isset($_POST["testpost"])) if (! isset($_GET["testget"]) && ! isset($_POST["testpost"]))
@ -79,7 +82,8 @@ else
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportPOSTGETOk")."<br>\n"; print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupportPOSTGETOk")."<br>\n";
} }
// Si session non actives
// Check if sessions enabled
if (! function_exists("session_id")) if (! function_exists("session_id"))
{ {
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions")."<br>\n"; print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportSessions")."<br>\n";
@ -133,6 +137,8 @@ else
$allowupgrade=0; $allowupgrade=0;
} }
// Si fichier absent et n'a pu etre créé // Si fichier absent et n'a pu etre créé
if (! file_exists($conffile)) if (! file_exists($conffile))
{ {
@ -226,6 +232,7 @@ else
} }
pFooter(1); // 1 car ne doit jamais afficher bouton Suivant pFooter(1); // 1 car ne doit jamais afficher bouton Suivant
?> ?>

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* *
@ -28,6 +28,8 @@
\version $Revision$ \version $Revision$
*/ */
define('DONOTLOADCONF',1); // To avoid loading conf by file inc..php
include_once("./inc.php"); include_once("./inc.php");
$setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto'); $setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto');
@ -181,7 +183,7 @@ if ($_POST["action"] == "set")
if (! is_dir($main_data_dir)) if (! is_dir($main_data_dir))
{ {
print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir); print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir);
print "Vous devez créer ce dossier et permettre au serveur web d'écrire dans celui-ci"; print $langs->trans("YouMustCreateItAndAllowServerToWrite");
print '</td><td>'; print '</td><td>';
print $langs->trans("Error"); print $langs->trans("Error");
print "</td></tr>"; print "</td></tr>";
@ -301,7 +303,7 @@ if ($_POST["action"] == "set")
{ {
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
dolibarr_syslog("Utilisateur deja existant"); dolibarr_syslog("User already exists");
print '<tr><td>'; print '<tr><td>';
print $langs->trans("UserCreation").' : '; print $langs->trans("UserCreation").' : ';
print $dolibarr_main_db_user; print $dolibarr_main_db_user;
@ -310,7 +312,7 @@ if ($_POST["action"] == "set")
} }
else else
{ {
dolibarr_syslog("impossible de creer l'utilisateur"); dolibarr_syslog("Failed to create user");
print '<tr><td>'; print '<tr><td>';
print $langs->trans("UserCreation").' : '; print $langs->trans("UserCreation").' : ';
print $dolibarr_main_db_user; print $dolibarr_main_db_user;
@ -331,9 +333,10 @@ if ($_POST["action"] == "set")
print '</tr>'; print '</tr>';
// Affiche aide diagnostique // Affiche aide diagnostique
print '<tr><td colspan="2"><br>Vous avez demandé la création du login Dolibarr "<b>'.$dolibarr_main_db_user.'</b>", mais pour cela, '; print '<tr><td colspan="2"><br>';
print 'Vous avez demandé la création du login Dolibarr "<b>'.$dolibarr_main_db_user.'</b>", mais pour cela, ';
print 'Dolibarr doit se connecter sur le serveur "<b>'.$dolibarr_main_db_host.'</b>" via le super utilisateur "<b>'.$userroot.'</b>".<br>'; print 'Dolibarr doit se connecter sur le serveur "<b>'.$dolibarr_main_db_host.'</b>" via le super utilisateur "<b>'.$userroot.'</b>".<br>';
print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects. '; print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects.<br>';
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
print '</td></tr>'; print '</td></tr>';
@ -374,7 +377,7 @@ if ($_POST["action"] == "set")
{ {
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
dolibarr_syslog("Utilisateur deja existant"); dolibarr_syslog("User already exists");
print '<tr><td>'; print '<tr><td>';
print $langs->trans("UserCreation").' : '; print $langs->trans("UserCreation").' : ';
print $dolibarr_main_db_user; print $dolibarr_main_db_user;
@ -383,7 +386,7 @@ if ($_POST["action"] == "set")
} }
else else
{ {
dolibarr_syslog("impossible de creer l'utilisateur"); dolibarr_syslog("Failed to create user");
print '<tr><td>'; print '<tr><td>';
print $langs->trans("UserCreation").' : '; print $langs->trans("UserCreation").' : ';
print $dolibarr_main_db_user; print $dolibarr_main_db_user;
@ -402,9 +405,10 @@ if ($_POST["action"] == "set")
print '</tr>'; print '</tr>';
// Affiche aide diagnostique // Affiche aide diagnostique
print '<tr><td colspan="2"><br>Vous avez demandé la création du login Dolibarr "<b>'.$dolibarr_main_db_user.'</b>", mais pour cela, '; print '<tr><td colspan="2"><br>';
print 'Vous avez demandé la création du login Dolibarr "<b>'.$dolibarr_main_db_user.'</b>", mais pour cela, ';
print 'Dolibarr doit se connecter sur le serveur "<b>'.$dolibarr_main_db_host.'</b>" via le super utilisateur "<b>'.$userroot.'</b>".<br>'; print 'Dolibarr doit se connecter sur le serveur "<b>'.$dolibarr_main_db_host.'</b>" via le super utilisateur "<b>'.$userroot.'</b>".<br>';
print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects. '; print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects.<br>';
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
print '</td></tr>'; print '</td></tr>';
@ -444,8 +448,10 @@ if ($_POST["action"] == "set")
print '<td>'.$langs->trans("Error").' '.$db->errno().'</td></tr>'; print '<td>'.$langs->trans("Error").' '.$db->errno().'</td></tr>';
// Affiche aide diagnostique // Affiche aide diagnostique
print '<tr><td colspan="2"><br>La création de la base Dolibarr "<b>'.$dolibarr_main_db_name.'</b>" a échoué.'; print '<tr><td colspan="2"><br>';
print 'Si la base existe déjà, revenez en arrière et désactiver l\'option "Créer la base de donnée".<br>'; print $langs->trans("ErrorFailedToCreateDatabase",$dolibarr_main_db_name).'<br>';
print $langs->trans("IfDatabaseExistsGoBackAndCheckCreate");
print '<br>';
print '</td></tr>'; print '</td></tr>';
$error++; $error++;
@ -463,7 +469,7 @@ if ($_POST["action"] == "set")
// Affiche aide diagnostique // Affiche aide diagnostique
print '<tr><td colspan="2"><br>Vous avez demandé la création de la base Dolibarr "<b>'.$dolibarr_main_db_name.'</b>", mais pour cela, '; print '<tr><td colspan="2"><br>Vous avez demandé la création de la base Dolibarr "<b>'.$dolibarr_main_db_name.'</b>", mais pour cela, ';
print 'Dolibarr doit se connecter sur le serveur "<b>'.$dolibarr_main_db_host.'</b>" via le super utilisateur "<b>'.$userroot.'</b>".<br>'; print 'Dolibarr doit se connecter sur le serveur "<b>'.$dolibarr_main_db_host.'</b>" via le super utilisateur "<b>'.$userroot.'</b>".<br>';
print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects. '; print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects.<br>';
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
print '</td></tr>'; print '</td></tr>';
@ -525,7 +531,7 @@ if ($_POST["action"] == "set")
// Affiche aide diagnostique // Affiche aide diagnostique
print '<tr><td colspan="2"><br>Vérifier que le nom de base "<b>'.$dolibarr_main_db_name.'</b>" est correct.<br>'; print '<tr><td colspan="2"><br>Vérifier que le nom de base "<b>'.$dolibarr_main_db_name.'</b>" est correct.<br>';
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 '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".<br>';
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
print '</td></tr>'; print '</td></tr>';
@ -552,6 +558,7 @@ if ($_POST["action"] == "set")
} }
} }
} }
print '</table>'; print '</table>';
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -44,9 +45,12 @@ if (file_exists($conffile))
if ($dolibarr_main_document_root) if ($dolibarr_main_document_root)
{ {
require_once($dolibarr_main_document_root . "/conf/conf.class.php"); require_once($dolibarr_main_document_root . "/conf/conf.class.php");
require_once($dolibarr_main_document_root . "/lib/databases/".$dolibarr_main_db_type.".lib.php");
$conf=new Conf(); $conf=new Conf();
} }
if ($dolibarr_main_document_root && $dolibarr_main_db_type && ! defined('DONOTLOADCONF'))
{
require_once($dolibarr_main_document_root . "/lib/databases/".$dolibarr_main_db_type.".lib.php");
}
} }
if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_'; if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_';
define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix); define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix);
@ -106,7 +110,7 @@ function pHeader($soutitre,$next,$action='set')
print '<title>'.$langs->trans("DolibarrSetup").'</title>'; print '<title>'.$langs->trans("DolibarrSetup").'</title>';
print '</head>'; print '</head>';
print '<body>'; print '<body>';
print '<span class="titre"><a class="titre" href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("DolibarrSetup").'</a></span>'; print '<span class="titre">'.$langs->trans("DolibarrSetup").'</span>';
print '<form action="'.$next.'.php" method="POST">'; print '<form action="'.$next.'.php" method="POST">';
print '<input type="hidden" name="testpost" value="ok">'; print '<input type="hidden" name="testpost" value="ok">';

View File

@ -16,9 +16,10 @@ ErrorPHPDoesNotSupportSessions=Your PHP installation does not support sessions.
ErrorDirDoesNotExists=Directory %s does not exists. ErrorDirDoesNotExists=Directory %s does not exists.
ErrorGoBackAndCorrectParameters=Go backward and correct wrong parameters. ErrorGoBackAndCorrectParameters=Go backward and correct wrong parameters.
ErrorWrongValueForParameter=You may have typed a wrong value for parameter '%s'. ErrorWrongValueForParameter=You may have typed a wrong value for parameter '%s'.
ErrorFailedToCreateDatabase=Failed to create database '%'. ErrorFailedToCreateDatabase=Failed to create database '%s'.
ErrorFailedToConnectToDatabase=Failed to connect to database '%'. ErrorFailedToConnectToDatabase=Failed to connect to database '%s'.
ErrorPHPVersionTooLow=PHP version too old. Version %s is required. ErrorPHPVersionTooLow=PHP version too old. Version %s is required.
IfDatabaseExistsGoBackAndCheckCreate=If database already exists, go back and uncheck "Create database" option.
PHPVersion=PHP Version PHPVersion=PHP Version
YouCanContinue=You can continue... YouCanContinue=You can continue...
License=Using license License=Using license
@ -95,6 +96,7 @@ CorrectProblemAndReloadPage=Correct problem and <a href="%s">reload page</a> (Pr
AlreadyDone=Already migrated AlreadyDone=Already migrated
DatabaseVersion=Database version DatabaseVersion=Database version
ServerVersion=Database server version ServerVersion=Database server version
YouMustCreateItAndAllowServerToWrite=You must create this directory and grant web server to write into.
######### #########
# upgrade # upgrade

View File

@ -41,6 +41,7 @@ ReturnCodeLastAccess=Return code for last database access
InformationLastAccess=Information for last database access InformationLastAccess=Information for last database access
DolibarrHasDetectedError=Dolibarr has detected a technical error DolibarrHasDetectedError=Dolibarr has detected a technical error
InformationToHelpDiagnose=This is information that can help to diagnose InformationToHelpDiagnose=This is information that can help to diagnose
MoreInformation=More information
NotePublic=Note (public) NotePublic=Note (public)
NotePrivate=Note (private) NotePrivate=Note (private)
yes=yes yes=yes

View File

@ -16,9 +16,10 @@ ErrorPHPDoesNotSupportSessions=Votre installation PHP ne supporte pas les sessio
ErrorDirDoesNotExists=Le répertoire <b>%s</b> n'existe pas ou n'est pas accessible. ErrorDirDoesNotExists=Le répertoire <b>%s</b> n'existe pas ou n'est pas accessible.
ErrorGoBackAndCorrectParameters=Revenez en arrière et corrigez les paramètres invalides. ErrorGoBackAndCorrectParameters=Revenez en arrière et corrigez les paramètres invalides.
ErrorWrongValueForParameter=Vous avez peut-être saisi une mauvaise valeur pour le paramètre '%s'. ErrorWrongValueForParameter=Vous avez peut-être saisi une mauvaise valeur pour le paramètre '%s'.
ErrorFailedToCreateDatabase=Echec de création de la base '%'. ErrorFailedToCreateDatabase=Echec de création de la base '%s'.
ErrorFailedToConnectToDatabase=Echec de connection à la base '%'. ErrorFailedToConnectToDatabase=Echec de connection à la base '%s'.
ErrorPHPVersionTooLow=Version de PHP trop ancienne. La version %s est requise. ErrorPHPVersionTooLow=Version de PHP trop ancienne. La version %s est requise.
IfDatabaseExistsGoBackAndCheckCreate=Si la base existe déjà, revenez en arrière et désactiver l'option "Créer la base de donnée".
PHPVersion=Version PHP PHPVersion=Version PHP
YouCanContinue=Vous pouvez continuer... YouCanContinue=Vous pouvez continuer...
License=Licence d'utilisation License=Licence d'utilisation
@ -96,6 +97,7 @@ CorrectProblemAndReloadPage=Corrigez le probl
AlreadyDone=Déjà migré AlreadyDone=Déjà migré
DatabaseVersion=Version de la base DatabaseVersion=Version de la base
ServerVersion=Version du serveur de base de donnée ServerVersion=Version du serveur de base de donnée
YouMustCreateItAndAllowServerToWrite=Vous devez créer ce dossier et permettre au serveur web d'écrire dans celui-ci.
######### #########
# upgrade # upgrade

View File

@ -41,6 +41,7 @@ ReturnCodeLastAccess=Code retour dernier acces en base
InformationLastAccess=Information sur le dernier accès en base InformationLastAccess=Information sur le dernier accès en base
DolibarrHasDetectedError=Dolibarr a détecté une erreur technique DolibarrHasDetectedError=Dolibarr a détecté une erreur technique
InformationToHelpDiagnose=Voici les informations qui pourront aider au diagnostic InformationToHelpDiagnose=Voici les informations qui pourront aider au diagnostic
MoreInformation=Plus d'information
NotePublic=Note (publique) NotePublic=Note (publique)
NotePrivate=Note (privée) NotePrivate=Note (privée)
yes=oui yes=oui