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
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* 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>";
// 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;
include_once($conffile);
@ -57,7 +59,7 @@ else
{
// Si non on le crée
$confexists=0;
$fp = @fopen("$conffile", "w");
$fp = @fopen($conffile, "w");
if($fp)
{
@fwrite($fp, '<?php');

View File

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