diff --git a/build/deb/postinst b/build/deb/postinst
index e5ba6135f8d..7df40f3e33c 100644
--- a/build/deb/postinst
+++ b/build/deb/postinst
@@ -49,10 +49,8 @@ echo Run the dolibarr postinst script
# Define vars
docdir='/var/lib/dolibarr/documents'
-#docdir='/usr/share/dolibarr/documents'
installfileorig="/usr/share/dolibarr/build/deb/install.forced.php.install"
installconfig="/etc/dolibarr/install.forced.php"
-#config="/usr/share/dolibarr/htdocs/conf/conf.php"
config="/etc/dolibarr/conf.php"
diff --git a/build/deb/postrm b/build/deb/postrm
index 27ce3777b7e..031f3f70d66 100644
--- a/build/deb/postrm
+++ b/build/deb/postrm
@@ -54,10 +54,8 @@ echo Run the dolibarr postrm script
docdir='/var/lib/dolibarr/documents'
-#docdir='/usr/share/dolibarr/documents'
-#config="/usr/share/dolibarr/htdocs/conf/conf.php"
config="/etc/dolibarr/conf.php"
-lockfile="/usr/share/dolibarr/install.lock"
+lockfile="$docdir/install.lock"
diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec
index 06cebcfcb2f..d6fcc0de06c 100644
--- a/build/rpm/dolibarr.spec
+++ b/build/rpm/dolibarr.spec
@@ -154,8 +154,6 @@ export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf"
export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf"
#export config="/usr/share/dolibarr/htdocs/conf/conf.php"
export config="%{_sysconfdir}/dolibarr/conf.php"
-export lockfile="/usr/share/dolibarr/install.lock"
-
# Detect OS
os='unknown';
@@ -223,11 +221,9 @@ if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then
# semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local
semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)"
#semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr(/.*?)"
- semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr/install.lock"
semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)"
restorecon -R -v /etc/dolibarr
#restorecon -R -v /usr/share/dolibarr
- restorecon -v /usr/share/dolibarr/install.lock
restorecon -R -v /var/lib/dolibarr
fi
@@ -288,7 +284,6 @@ export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf"
export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf"
#export config="/usr/share/dolibarr/htdocs/conf/conf.php"
export config="%{_sysconfdir}/dolibarr/conf.php"
-export lockfile="$targetdir/install.lock"
# Detect OS
@@ -345,8 +340,8 @@ echo Removed remaining $config
%{__rm} -f $config
echo Removed remaining $installconfig
%{__rm} -f $installconfig
-echo Removed remaining $lockfile
-%{__rm} -f $lockfile
+echo Removed remaining $docdir/install.lock
+%{__rm} -f $docdir/install.lock
%changelog
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index 3148174f5af..0bb3054197d 100755
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -27,7 +27,7 @@
* \file htdocs/filefunc.inc.php
* \ingroup core
* \brief File that include conf.php file and functions.lib.php
- * \version $Id: filefunc.inc.php,v 1.21 2011/07/31 23:19:04 eldy Exp $
+ * \version $Id: filefunc.inc.php,v 1.22 2011/08/04 12:07:29 eldy Exp $
*/
define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
@@ -60,6 +60,7 @@ error_reporting(E_ALL ^ E_NOTICE);
//error_reporting(E_ALL);
+# Define vars
$conffiletoshowshort = "conf.php";
# Define localization of conf file
$conffile = "conf/conf.php";
diff --git a/htdocs/index.php b/htdocs/index.php
index f027e94a35a..adbe84b25e1 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -20,7 +20,7 @@
/**
* \file htdocs/index.php
* \brief Dolibarr home page
- * \version $Id: index.php,v 1.200 2011/07/31 23:19:05 eldy Exp $
+ * \version $Id: index.php,v 1.201 2011/08/04 12:07:30 eldy Exp $
*/
define('NOCSRFCHECK',1); // This is login page. We must be able to go on it from another web site.
@@ -545,8 +545,9 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
{
$message='';
- // Install lock missing
- if (! file_exists('../install.lock') && is_dir(DOL_DOCUMENT_ROOT."/install"))
+ // Check if install lock file is present
+ $lockfile=DOL_DATA_ROOT.'/install.lock';
+ if (! empty($lockfile) && ! file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install"))
{
$langs->load("other");
//if (! empty($message)) $message.='
';
@@ -573,7 +574,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
$db->close();
-llxFooter('$Date: 2011/07/31 23:19:05 $ - $Revision: 1.200 $');
+llxFooter('$Date: 2011/08/04 12:07:30 $ - $Revision: 1.201 $');
/**
diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php
index 50fa9904890..b64f01b4b80 100644
--- a/htdocs/install/etape5.php
+++ b/htdocs/install/etape5.php
@@ -23,7 +23,7 @@
* \file htdocs/install/etape5.php
* \ingroup install
* \brief Last page of upgrade or install process
- * \version $Id: etape5.php,v 1.107 2011/07/31 23:26:19 eldy Exp $
+ * \version $Id: etape5.php,v 1.108 2011/08/04 12:07:30 eldy Exp $
*/
include_once("./inc.php");
@@ -314,7 +314,8 @@ if ($action == "set")
if (! empty($force_install_lockinstall))
{
// Install is finished, we create the lock file
- $fp = @fopen($lockfile, "w");
+ $lockfile=DOL_DATA_ROOT.'/install.lock';
+ $fp = @fopen($lockfile, "w");
if ($fp)
{
if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
@@ -363,7 +364,8 @@ elseif (preg_match('/upgrade/i',$action))
if (! empty($force_install_lockinstall))
{
// Upgrade is finished, we create the lock file
- $fp = @fopen($lockfile, "w");
+ $lockfile=DOL_DATA_ROOT.'/install.lock';
+ $fp = @fopen($lockfile, "w");
if ($fp)
{
if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index 223a2eb6d92..039d8c8b67b 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -21,7 +21,7 @@
/** \file htdocs/install/inc.php
* \ingroup core
* \brief File that define environment for install pages
- * \version $Id: inc.php,v 1.137 2011/07/31 23:26:18 eldy Exp $
+ * \version $Id: inc.php,v 1.138 2011/08/04 12:07:30 eldy Exp $
*/
define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
@@ -70,16 +70,15 @@ else
$includeconferror='';
+# Define vars
$conffiletoshowshort = "conf.php";
# Define localization of conf file
$conffile = "../conf/conf.php";
$conffiletoshow = "htdocs/conf/conf.php";
-$lockfile = '../../install.lock';
# For debian/redhat like systems
#$conffile = "/etc/dolibarr/conf.php";
#$conffiletoshow = "/etc/dolibarr/conf.php";
-#$lockfile = '/etc/dolibarr/install.lock'; # Web has no permission to write here
-$lockfile = '../../install.lock';
+
if (! defined('DONOTLOADCONF') && file_exists($conffile))
{
@@ -128,7 +127,6 @@ if (! defined('DONOTLOADCONF') && file_exists($conffile))
}
$conf->global->MAIN_LOGTOHTML=1;
-
// Define prefix
if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_';
define('MAIN_DB_PREFIX',(isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefix:''));
@@ -179,6 +177,7 @@ if (preg_match('/install.lock/i',$_SERVER["SCRIPT_FILENAME"]))
}
exit;
}
+$lockfile=DOL_DATA_ROOT.'/install.lock';
if (file_exists($lockfile))
{
print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr root directory).
';