Fix: le fichier de conf tait cras suite un test erron

This commit is contained in:
marc_ocebo 2005-11-03 18:00:17 +00:00
parent cc0939ecde
commit 49dbabe689
2 changed files with 94 additions and 108 deletions

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Océbo <marc@ocebo.com>
* *
* 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,7 +45,8 @@ pHeader($langs->trans("DolibarrWelcome"),""); // Etape suivante = license
print $langs->trans("InstallEasy")."<br>"; print $langs->trans("InstallEasy")."<br>";
// Si fichier présent et lisible et renseigné // Si fichier présent et lisible et renseigné
if (is_readable($conffile) && sizeof($conffile) > 8) clearstatcache();
if (is_readable($conffile) && filesize($conffile) > 8)
{ {
$confexists=1; $confexists=1;
include_once($conffile); include_once($conffile);
@ -57,7 +59,7 @@ else
{ {
// Si non on le crée // Si non on le crée
$confexists=0; $confexists=0;
$fp = @fopen("$conffile", "w"); $fp = @fopen($conffile, "w");
if($fp) if($fp)
{ {
@fwrite($fp, '<?php'); @fwrite($fp, '<?php');

View File

@ -20,33 +20,24 @@
* $Id$ * $Id$
* $Source$ * $Source$
*/ */
/** \file htdocs/install/inc.php /** \file htdocs/install/inc.php
\brief Fichier include du programme d'installation \brief Fichier include du programme d'installation
\version $Revision$ \version $Revision$
*/ */
$docurl = '<a href="doc/dolibarr-install.html">documentation</a>'; $docurl = '<a href="doc/dolibarr-install.html">documentation</a>';
$conffile = "../conf/conf.php"; $conffile = "../conf/conf.php";
// Defini objet langs // Defini objet langs
require_once('../translate.class.php'); require_once('../translate.class.php');
$langs = new Translate('../langs'); $langs = new Translate('../langs');
$langs->setDefaultLang('auto'); $langs->setDefaultLang('auto');
$langs->setPhpLang(); $langs->setPhpLang();
$tab[0]=' class="bg1"'; $tab[0]=' class="bg1"';
$tab[1]=' class="bg2"'; $tab[1]=' class="bg2"';
function pHeader($soutitre,$next,$action='set') function pHeader($soutitre,$next,$action='set')
{ {
global $langs; global $langs;
$langs->load("main"); $langs->load("main");
$langs->load("admin"); $langs->load("admin");
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n"; print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
print '<html>'; print '<html>';
print '<head>'; print '<head>';
@ -55,9 +46,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="index.php">'.$langs->trans("DolibarrSetup").'</a></span>'; print '<span class="titre"><a class="titre" href="index.php">'.$langs->trans("DolibarrSetup").'</a></span>';
print '<form action="'.$next.'.php" method="POST">'; print '<form action="'.$next.'.php" method="POST">';
print '<input type="hidden" name="action" value="'.$action.'">'; print '<input type="hidden" name="action" value="'.$action.'">';
print '<div class="main">'; print '<div class="main">';
@ -66,8 +55,6 @@ function pHeader($soutitre,$next,$action='set')
} }
print '<div class="main-inside">'; print '<div class="main-inside">';
} }
function pFooter($nonext=0,$setuplang='') function pFooter($nonext=0,$setuplang='')
{ {
global $langs; global $langs;
@ -87,8 +74,6 @@ function pFooter($nonext=0,$setuplang='')
print '</body>'; print '</body>';
print '</html>'; print '</html>';
} }
function dolibarr_syslog($message) function dolibarr_syslog($message)
{ {
// Les fonctions syslog ne sont pas toujours installés ou autorisées chez les hébergeurs // Les fonctions syslog ne sont pas toujours installés ou autorisées chez les hébergeurs
@ -103,5 +88,4 @@ function dolibarr_syslog($message)
// } // }
} }
} }
?> ?>