* Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Océbo * * 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$ */ /** \file htdocs/install/check.php \ingroup install \brief Test si le fichier conf est modifiable et si il n'existe pas, test la possibilité de le créer \version $Revision$ */ $err = 0; $allowinstall = 0; $allowupgrade = 0; include_once("./inc.php"); $setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:$langs->getDefaultLang()); $langs->setDefaultLang($setuplang); $langs->load("install"); dolibarr_install_syslog("Dolibarr install/upgrade process started"); pHeader($langs->trans("DolibarrWelcome"),""); // Etape suivante = license print '
Dolibarr logo

'; print "
"; print $langs->trans("InstallEasy")."
"; // Si fichier présent et lisible et renseigné clearstatcache(); if (is_readable($conffile) && filesize($conffile) > 8) { $confexists=1; include_once($conffile); // Deja installé, on peut upgrader // \todo Test if database ok $allowupgrade=1; } else { // Si non on le crée $confexists=0; $fp = @fopen($conffile, "w"); if($fp) { @fwrite($fp, '"); fclose($fp); } // First install, on ne peut pas upgrader $allowupgrade=0; } // Si fichier absent et n'a pu etre créé if (!file_exists($conffile)) { 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 fichier présent mais ne peut etre modifié if (!is_writable($conffile)) { if ($confexists) { print $langs->trans("ConfFileExists",'conf.php'); } else { print $langs->trans("ConfFileCouldBeCreated",'conf.php'); } print "
"; print $langs->trans("ConfFileIsNotWritable",'htdocs/conf/conf.php'); print "
"; $allowinstall=0; } // Si fichier présent et peut etre modifié else { if ($confexists) { print $langs->trans("ConfFileExists",'conf.php'); } else { print $langs->trans("ConfFileCouldBeCreated",'conf.php'); } print "
"; print $langs->trans("ConfFileIsWritable",'conf.php'); print "
"; $allowinstall=1; } print "
\n"; print "
\n"; // Si pas d'erreur, on affiche le bouton pour passer à l'étape suivante print $langs->trans("ChooseYourSetupMode"); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("FreshInstall").''; print $langs->trans("FreshInstallDesc").''; if ($allowinstall) { print ''.$langs->trans("Start").''; } else { print $langs->trans("InstallNotAllowed"); } print '
'.$langs->trans("Upgrade").''; print $langs->trans("UpgradeDesc").''; if ($allowupgrade) { print ''.$langs->trans("Start").''; } else { print $langs->trans("NotAvailable"); } print '
'; print "\n"; } print ''; print ''; print ''; print ''; print ''; ?>