Merge remote-tracking branch 'origin/support/2.6' into support/2.7

# Conflicts:
#	pages/ajax.render.php
#	setup/wizardsteps.class.inc.php
This commit is contained in:
Pierre Goiffon
2021-11-17 17:39:36 +01:00
6 changed files with 64 additions and 45 deletions

View File

@@ -141,7 +141,7 @@ header("Expires: Fri, 17 Jul 1970 05:00:00 GMT"); // Date in the past
$sOperation = Utils::ReadParam('operation', '');
try
{
SetupUtils::CheckSetupToken();
SetupUtils::CheckSetupToken(true);
switch($sOperation)
{

View File

@@ -2540,11 +2540,13 @@ class WizStepDone extends WizardStep
$oPage->ok("The installation completed successfully.");
}
$bHasBackup = false;
if (($this->oWizard->GetParameter('mode', '') == 'upgrade') && $this->oWizard->GetParameter('db_backup', false) && $this->oWizard->GetParameter('authent', false))
{
$sBackupDestination = $this->oWizard->GetParameter('db_backup_path', '');
if (file_exists($sBackupDestination.'.tar.gz'))
{
$bHasBackup = true;
// To mitigate security risks: pass only the filename without the extension, the download will add the extension itself
$oPage->p('Your backup is ready');
$oPage->p('<a style="background:transparent;" href="'.utils::GetAbsoluteUrlAppRoot(true).'setup/ajax.dataloader.php?operation=async_action&step_class=WizStepDone&params[backup]='.urlencode($sBackupDestination).'&authent='.$this->oWizard->GetParameter('authent','').'" target="_blank"><img src="../images/tar.png" style="border:0;vertical-align:middle;">&nbsp;Download '.basename($sBackupDestination).'</a>');
@@ -2665,10 +2667,14 @@ class WizStepDone extends WizardStep
$oPage->add('<img style="border:0" src="'.$sImgUrl.'"/>');
$sForm = addslashes($sForm);
$oPage->add_ready_script("$('#wiz_form').after('$sForm');");
// avoid leaving in a dirty state
SetupUtils::ExitMaintenanceMode(false);
SetupUtils::ExitReadOnlyMode(false);
SetupUtils::EraseSetupToken();
if (false === $bHasBackup) {
SetupUtils::EraseSetupToken();
}
}
public function CanMoveForward()