diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 8a39faf526a..b7d320aab59 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -342,7 +342,8 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action)) // Create lock file // If first install -if ($action == "set" && $success) { +if ($action == "set" && $success) +{ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { // Install is finished @@ -350,14 +351,14 @@ if ($action == "set" && $success) { $createlock=0; - if (! empty($force_install_lockinstall)) + if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Install is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; $fp = @fopen($lockfile, "w"); if ($fp) { - if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility + if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")"); fclose($fp); @chmod($lockfile, octdec($force_install_lockinstall)); @@ -400,14 +401,14 @@ elseif (empty($action) || preg_match('/upgrade/i',$action)) $createlock=0; - if (! empty($force_install_lockinstall)) + if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Upgrade is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; $fp = @fopen($lockfile, "w"); if ($fp) { - if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility + if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")"); fclose($fp); @chmod($lockfile, octdec($force_install_lockinstall));