Fix: save old conf file

This commit is contained in:
Regis Houssin 2010-02-04 09:54:45 +00:00
parent c534a8ffae
commit 6730445a50
2 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
*
* 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
@ -158,7 +159,7 @@ if ($_POST["action"] == "set")
$dir[0] = "$main_data_dir/facture";
$dir[1] = "$main_data_dir/users";
$dir[2] = "$main_data_dir/propale";
$dir[3] = "$main_data_dir/societe";
$dir[3] = "$main_data_dir/mycompany";
$dir[4] = "$main_data_dir/ficheinter";
$dir[5] = "$main_data_dir/produit";
$dir[6] = "$main_data_dir/rapport";
@ -204,6 +205,13 @@ if ($_POST["action"] == "set")
// Write conf file on disk
if (! $error)
{
// Save old conf file on disk
if (file_exists("$conffile"))
{
$oldcontent = dol_openfile($conffile, 'r', '');
if (! dol_openfile($conffile.'.old', 'w', $oldcontent)) $error++;
}
$error+=write_conf_file($conffile);
}

View File

@ -30,6 +30,7 @@ define('DOL_VERSION','2.8.0-dev'); // Also defined in htdocs/master.inc.php
require_once('../translate.class.php');
require_once('../lib/functions.lib.php');
require_once('../lib/admin.lib.php');
require_once('../lib/files.lib.php');
// DOL_DOCUMENT_ROOT has been defined in function.inc.php to '..'