N°9711 - Block user from going back to the setup (#944)

This commit is contained in:
Eric Espié
2026-06-22 17:12:57 +02:00
committed by GitHub
parent 614d3586c8
commit f1af3d5c5f
8 changed files with 97 additions and 76 deletions

View File

@@ -22,6 +22,7 @@ abstract class AbstractWizStepInstall extends WizardStep
{
/**
* Prepare the parameters to execute the installation asynchronously
*
* @return array A big hash array that can be converted to XML or JSON with all the needed parameters
*/
protected function BuildConfig()
@@ -60,50 +61,50 @@ abstract class AbstractWizStepInstall extends WizardStep
$sSourceDir = APPROOT.'modules';
}
$aInstallParams = [
'mode' => $sMode,
'optional_steps' => [
$aInstallParams = [
'mode' => $sMode,
'optional_steps' => [
'log-parameters' => true,
'migrate-before' => true,
'migrate-after' => true,
'setup-audit' => true,
'migrate-after' => true,
'setup-audit' => true,
// 'backup' => see below
],
'source_dir' => str_replace(APPROOT, '', $sSourceDir),
'datamodel_version' => $this->oWizard->GetParameter('datamodel_version'), //TODO: let the installer compute this automatically...
'source_dir' => str_replace(APPROOT, '', $sSourceDir),
'datamodel_version' => $this->oWizard->GetParameter('datamodel_version'), //TODO: let the installer compute this automatically...
'previous_configuration_file' => $sPreviousConfigurationFile,
'extensions_dir' => $this->oWizard->GetParameter('extensions_dir', 'extensions'),
'target_env' => $this->oWizard->GetParameter('target_env', ITOP_DEFAULT_ENV),
'workspace_dir' => '',
'database' => [
'server' => $this->oWizard->GetParameter('db_server'),
'user' => $this->oWizard->GetParameter('db_user'),
'pwd' => $this->oWizard->GetParameter('db_pwd'),
'name' => $sDBName,
'extensions_dir' => $this->oWizard->GetParameter('extensions_dir', 'extensions'),
'target_env' => $this->oWizard->GetParameter('target_env', ITOP_DEFAULT_ENV),
'workspace_dir' => '',
'database' => [
'server' => $this->oWizard->GetParameter('db_server'),
'user' => $this->oWizard->GetParameter('db_user'),
'pwd' => $this->oWizard->GetParameter('db_pwd'),
'name' => $sDBName,
'db_tls_enabled' => $this->oWizard->GetParameter('db_tls_enabled'),
'db_tls_ca' => $this->oWizard->GetParameter('db_tls_ca'),
'prefix' => $this->oWizard->GetParameter('db_prefix'),
'db_tls_ca' => $this->oWizard->GetParameter('db_tls_ca'),
'prefix' => $this->oWizard->GetParameter('db_prefix'),
],
'url' => $this->oWizard->GetParameter('application_url'),
'graphviz_path' => $this->oWizard->GetParameter('graphviz_path'),
'admin_account' => [
'user' => $this->oWizard->GetParameter('admin_user'),
'pwd' => $this->oWizard->GetParameter('admin_pwd'),
'url' => $this->oWizard->GetParameter('application_url'),
'graphviz_path' => $this->oWizard->GetParameter('graphviz_path'),
'admin_account' => [
'user' => $this->oWizard->GetParameter('admin_user'),
'pwd' => $this->oWizard->GetParameter('admin_pwd'),
'language' => $this->oWizard->GetParameter('admin_language'),
],
'language' => $this->oWizard->GetParameter('default_language'),
'selected_modules' => $aSelectedModules,
'selected_extensions' => $aSelectedExtensions,
'sample_data' => $this->oWizard->GetParameter('sample_data', '') === 'yes',
'old_addon' => $this->oWizard->GetParameter('old_addon', false), // whether or not to use the "old" userrights profile addon
'options' => json_decode($this->oWizard->GetParameter('misc_options', '[]'), true),
'mysql_bindir' => $this->oWizard->GetParameter('mysql_bindir'),
'use_symbolic_links' => $this->oWizard->GetParameter('use_symbolic_links', MFCompiler::UseSymbolicLinks()),
'language' => $this->oWizard->GetParameter('default_language'),
'selected_modules' => $aSelectedModules,
'selected_extensions' => $aSelectedExtensions,
'sample_data' => $this->oWizard->GetParameter('sample_data', '') === 'yes',
'old_addon' => $this->oWizard->GetParameter('old_addon', false), // whether or not to use the "old" userrights profile addon
'options' => json_decode($this->oWizard->GetParameter('misc_options', '[]'), true),
'mysql_bindir' => $this->oWizard->GetParameter('mysql_bindir'),
'use_symbolic_links' => $this->oWizard->GetParameter('use_symbolic_links', MFCompiler::UseSymbolicLinks()),
];
if ($sBackupDestination != '') {
$aInstallParams['optional_steps']['backup'] = [
'destination' => $sBackupDestination,
$aInstallParams['optional_steps']['backup'] = [
'destination' => $sBackupDestination,
'configuration_file' => $sPreviousConfigurationFile,
];
}
@@ -115,4 +116,10 @@ abstract class AbstractWizStepInstall extends WizardStep
return $aInstallParams;
}
public function GetBackButtonInfo(): array
{
$sReturnApplication = $this->oWizard->GetParameter('return_application', '');
return SetupUtils::GetBackButtonInfo($sReturnApplication);
}
}