FIX possibility to force install lock with GET/POST or script
This commit is contained in:
parent
7c46ace042
commit
a2f514d4a1
@ -30,7 +30,7 @@ return "Regis Houssin";
|
|||||||
# script_dolibarr_versions()
|
# script_dolibarr_versions()
|
||||||
sub script_dolibarr_versions
|
sub script_dolibarr_versions
|
||||||
{
|
{
|
||||||
return ( "7.0.0", "6.0.5", "5.0.7" );
|
return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub script_dolibarr_release
|
sub script_dolibarr_release
|
||||||
@ -263,15 +263,16 @@ if ($upgrade) {
|
|||||||
local @params = ( [ "action", "upgrade" ],
|
local @params = ( [ "action", "upgrade" ],
|
||||||
[ "versionfrom", $upgrade->{'version'} ],
|
[ "versionfrom", $upgrade->{'version'} ],
|
||||||
[ "versionto", $ver ],
|
[ "versionto", $ver ],
|
||||||
|
[ "installlock", "1" ],
|
||||||
);
|
);
|
||||||
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
||||||
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
||||||
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
||||||
|
|
||||||
# Remove the installation directory.
|
# Remove the installation directory. (deprecated)
|
||||||
local $dinstall = "$opts->{'dir'}/install";
|
# local $dinstall = "$opts->{'dir'}/install";
|
||||||
$dinstall =~ s/\/$//;
|
# $dinstall =~ s/\/$//;
|
||||||
$out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
|
# $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -306,15 +307,18 @@ else {
|
|||||||
[ "login", "admin" ],
|
[ "login", "admin" ],
|
||||||
[ "pass", $dompass ],
|
[ "pass", $dompass ],
|
||||||
[ "pass_verif", $dompass ],
|
[ "pass_verif", $dompass ],
|
||||||
|
[ "installlock", "1" ],
|
||||||
);
|
);
|
||||||
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
||||||
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
||||||
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
||||||
|
|
||||||
# Remove the installation directory and protect config file.
|
# Remove the installation directory (deprecated)
|
||||||
local $dinstall = "$opts->{'dir'}/install";
|
# local $dinstall = "$opts->{'dir'}/install";
|
||||||
$dinstall =~ s/\/$//;
|
# $dinstall =~ s/\/$//;
|
||||||
$out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
|
# $out = &run_as_domain_user($d, "rm -rf ".quotemeta($dinstall));
|
||||||
|
|
||||||
|
# Protect config file
|
||||||
&set_permissions_as_domain_user($d, 0644, $cfile);
|
&set_permissions_as_domain_user($d, 0644, $cfile);
|
||||||
&set_permissions_as_domain_user($d, 0755, $cfiledir);
|
&set_permissions_as_domain_user($d, 0755, $cfiledir);
|
||||||
}
|
}
|
||||||
@ -386,6 +390,8 @@ sub script_dolibarr_check_latest
|
|||||||
{
|
{
|
||||||
local ($ver) = @_;
|
local ($ver) = @_;
|
||||||
local @vers = &osdn_package_versions("dolibarr",
|
local @vers = &osdn_package_versions("dolibarr",
|
||||||
|
$ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
|
$ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 6.0 ? "dolibarr\\-(6\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 6.0 ? "dolibarr\\-(6\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
|
|||||||
@ -38,6 +38,7 @@ $versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'alpha',3):(empty(
|
|||||||
$setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[3])?'auto':$argv[3]);
|
$setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[3])?'auto':$argv[3]);
|
||||||
$langs->setDefaultLang($setuplang);
|
$langs->setDefaultLang($setuplang);
|
||||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):(empty($argv[4])?'':$argv[4]);
|
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):(empty($argv[4])?'':$argv[4]);
|
||||||
|
$installlock=GETPOST('installlock','int')?GETPOST('installlock','int'):(empty($argv[5])?'':$argv[5]);
|
||||||
|
|
||||||
// Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install
|
// Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install
|
||||||
// or MAIN_VERSION_LAST_UPGRADE for upgrade.
|
// or MAIN_VERSION_LAST_UPGRADE for upgrade.
|
||||||
@ -362,7 +363,7 @@ if ($action == "set" && $success)
|
|||||||
|
|
||||||
$createlock=0;
|
$createlock=0;
|
||||||
|
|
||||||
if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
|
if (! empty($force_install_lockinstall) || ! empty($installlock) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
|
||||||
{
|
{
|
||||||
// Install is finished, we create the lock file
|
// Install is finished, we create the lock file
|
||||||
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
||||||
@ -412,7 +413,7 @@ elseif (empty($action) || preg_match('/upgrade/i',$action))
|
|||||||
|
|
||||||
$createlock=0;
|
$createlock=0;
|
||||||
|
|
||||||
if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
|
if (! empty($force_install_lockinstall) || ! empty($installlock) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
|
||||||
{
|
{
|
||||||
// Upgrade is finished, we create the lock file
|
// Upgrade is finished, we create the lock file
|
||||||
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user