Fix: Error when deleting lock file by doliwamp

This commit is contained in:
Laurent Destailleur 2010-08-19 22:32:33 +00:00
parent fbb59da164
commit 332b2fc4d7
4 changed files with 15 additions and 13 deletions

View File

@ -12,5 +12,5 @@ $force_install_databaserootlogin='__SUPERUSERLOGIN__';
$force_install_databaserootpass='__SUPERUSERPASSWORD__'; $force_install_databaserootpass='__SUPERUSERPASSWORD__';
$force_install_dolibarrlogin='admin'; $force_install_dolibarrlogin='admin';
$force_install_nophpinfo='1'; $force_install_nophpinfo='1';
$force_install_lockinstall='1'; $force_install_lockinstall='444';
?> ?>

View File

@ -12,5 +12,5 @@ $force_install_databaserootlogin='root';
$force_install_databaserootpass='root'; $force_install_databaserootpass='root';
$force_install_dolibarrlogin='admin'; $force_install_dolibarrlogin='admin';
$force_install_nophpinfo='1'; $force_install_nophpinfo='1';
$force_install_lockinstall='1'; $force_install_lockinstall='444';
?> ?>

View File

@ -12,5 +12,5 @@ $force_install_databaserootlogin='root';
$force_install_databaserootpass='WAMPMYSQLNEWPASSWORD'; $force_install_databaserootpass='WAMPMYSQLNEWPASSWORD';
$force_install_dolibarrlogin='admin'; $force_install_dolibarrlogin='admin';
$force_install_nophpinfo='1'; $force_install_nophpinfo='1';
$force_install_lockinstall='1'; $force_install_lockinstall='644';
?> ?>

View File

@ -149,7 +149,7 @@ if ($_POST["action"] == "set" || preg_match('/upgrade/i',$_POST["action"]))
$conf->setValues($db); $conf->setValues($db);
// Create user // Create user
include_once(DOL_DOCUMENT_ROOT ."/user/user.class.php"); include_once(DOL_DOCUMENT_ROOT ."/user/class/user.class.php");
$createuser=new User($db); $createuser=new User($db);
$createuser->id=0; $createuser->id=0;
@ -288,10 +288,11 @@ if ($_POST["action"] == "set")
$fp = @fopen($lockfile, "w"); $fp = @fopen($lockfile, "w");
if ($fp) if ($fp)
{ {
fwrite($fp, "This is a lock file to prevent use of install pages"); if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
fclose($fp); fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")");
@chmod($lockfile, octdec(444)); fclose($fp);
$createlock=1; @chmod($lockfile, octdec($force_install_lockinstall));
$createlock=1;
} }
} }
if (empty($createlock)) if (empty($createlock))
@ -311,7 +312,7 @@ if ($_POST["action"] == "set")
{ {
// If here MAIN_VERSION_LAST_UPGRADE is not empty // If here MAIN_VERSION_LAST_UPGRADE is not empty
print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</font></b><br>'; print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</font></b><br>';
print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b>'; print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b><br>';
print $langs->trans("MigrationNotFinished").'<br>'; print $langs->trans("MigrationNotFinished").'<br>';
print "<br>"; print "<br>";
@ -337,10 +338,11 @@ elseif (preg_match('/upgrade/i',$_POST["action"]))
$fp = @fopen($lockfile, "w"); $fp = @fopen($lockfile, "w");
if ($fp) if ($fp)
{ {
fwrite($fp, "This is a lock file to prevent use of install pages"); if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
fclose($fp); fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")");
@chmod($lockfile, octdec(444)); fclose($fp);
$createlock=1; @chmod($lockfile, octdec($force_install_lockinstall));
$createlock=1;
} }
} }
if (empty($createlock)) if (empty($createlock))