diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index b56161c7de5..e2b639916ab 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -43,8 +43,8 @@ pHeader($langs->trans("DolibarrWelcome"),""); // Etape suivante = license
print $langs->trans("InstallEasy")."
";
-// Si fichier présent et lisible
-if (is_readable($conffile))
+// Si fichier présent et lisible et renseigné
+if (is_readable($conffile) && sizeof($conffile) > 8)
{
$confexists=1;
include_once($conffile);
@@ -73,30 +73,31 @@ else
// Si fichier absent et n'a pu etre créé
if (!file_exists($conffile))
{
- print "
";
- print "Le fichier de configuration conf.php n'existe pas !";
- print "
";
- print "Vous devez créer un fichier htdocs/conf/conf.php et donner les droits d'écriture dans celui-ci au serveur web durant le processus d'installation.";
- print "
";
-
- print 'Corrigez le problème et rechargez la page.';
-
- $err++;
+ print "
";
+ print $langs->trans("ConfFileDoesNotExists",'conf.php');
+ print "
";
+ print $langs->trans("YouMustCreateWithPermission",'htdocs/conf/conf.php');
+ print "
";
+
+ print $langs->trans("CorrectProblemAndReloadPage");
+ $err++;
}
else
{
print "
\n";
- // Si ficiher présent mais ne peut etre modifié
+ // Si fichier présent mais ne peut etre modifié
if (!is_writable($conffile))
{
- if ($confexists) {
- print $langs->trans("ConfFileExists");
+ if ($confexists)
+ {
+ print $langs->trans("ConfFileExists",'conf.php');
}
- else {
- print $langs->trans("ConfFileCouldBeCreated");
+ else
+ {
+ print $langs->trans("ConfFileCouldBeCreated",'conf.php');
}
print "
";
- print $langs->trans("ConfFileIsNotWritable");
+ print $langs->trans("ConfFileIsNotWritable",'htdocs/conf/conf.php');
print "
";
$allowinstall=0;
@@ -104,14 +105,16 @@ else
// Si fichier présent et peut etre modifié
else
{
- if ($confexists) {
- print $langs->trans("ConfFileExists");
+ if ($confexists)
+ {
+ print $langs->trans("ConfFileExists",'conf.php');
}
- else {
- print $langs->trans("ConfFileCouldBeCreated");
+ else
+ {
+ print $langs->trans("ConfFileCouldBeCreated",'conf.php');
}
print "
";
- print $langs->trans("ConfFileIsWritable");
+ print $langs->trans("ConfFileIsWritable",'conf.php');
print "
";
$allowinstall=1;
diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php
index 5c348ae4777..846d05aa5de 100644
--- a/htdocs/install/fileconf.php
+++ b/htdocs/install/fileconf.php
@@ -54,26 +54,27 @@ print "";
if(! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0)
{
- // Si le php fonctionne en CGI, alors SCRIPT_FILENAME vaut le path du php et
- // ce n'est pas ce qu'on veut. Dans ce cas, on propose $_SERVER["DOCUMENT_ROOT"]
- if (eregi('php$',$_SERVER["SCRIPT_FILENAME"]) || eregi('php\.exe$',$_SERVER["SCRIPT_FILENAME"])) {
- $dolibarr_main_document_root=$_SERVER["DOCUMENT_ROOT"];
-
- if (! eregi('\/dolibarr/htdocs$',$dolibarr_main_document_root))
- {
- $dolibarr_main_document_root.="/dolibarr/htdocs";
- }
- }
- else
+ // Si le php fonctionne en CGI, alors SCRIPT_FILENAME vaut le path du php et
+ // ce n'est pas ce qu'on veut. Dans ce cas, on propose $_SERVER["DOCUMENT_ROOT"]
+ if (eregi('php$',$_SERVER["SCRIPT_FILENAME"]) || eregi('php\.exe$',$_SERVER["SCRIPT_FILENAME"]))
{
- $dolibarr_main_document_root = substr($_SERVER["SCRIPT_FILENAME"],0,strlen($_SERVER["SCRIPT_FILENAME"])- 21 );
- // Nettoyage du path proposé
- // Gere les chemins windows avec double "\"
- $dolibarr_main_document_root = str_replace('\\\\','/',$dolibarr_main_document_root);
-
- // Supprime le slash ou antislash final
- $dolibarr_main_document_root = ereg_replace('[\\\\\/]$','',$dolibarr_main_document_root);
- }
+ $dolibarr_main_document_root=$_SERVER["DOCUMENT_ROOT"];
+
+ if (! eregi('[\/\\]dolibarr[\/\\]htdocs$',$dolibarr_main_document_root))
+ {
+ $dolibarr_main_document_root.="/dolibarr/htdocs";
+ }
+ }
+ else
+ {
+ $dolibarr_main_document_root = substr($_SERVER["SCRIPT_FILENAME"],0,strlen($_SERVER["SCRIPT_FILENAME"]) - 21);
+ // Nettoyage du path propose
+ // Gere les chemins windows avec double "\"
+ $dolibarr_main_document_root = str_replace('\\\\','/',$dolibarr_main_document_root);
+
+ // Supprime les slash ou antislash de fins
+ $dolibarr_main_document_root = ereg_replace('[\\\/]+$','',$dolibarr_main_document_root);
+ }
}
?>
@@ -162,8 +163,8 @@ $dolibarr_main_db_host = "localhost";