oWizard);
$sRootUrl = utils::GetAbsoluteUrlAppRoot(true);
$aSelectedModules = json_decode($this->oWizard->GetParameter('selected_modules'), true);
foreach ($aSelectedModules as $sModuleId) {
if (!empty($aAvailableModules[$sModuleId]['doc.manual_setup'])) {
$sUrl = $aAvailableModules[$sModuleId]['doc.manual_setup'];
$sManualStepUrl = utils::IsURL($sUrl) ? $sUrl : $sRootUrl.$sUrl;
$aManualSteps[$aAvailableModules[$sModuleId]['label']] = $sManualStepUrl;
}
}
$oPage->add('
');
if (count($aManualSteps) > 0) {
$oPage->add("
Manual operations required
");
$oPage->p("In order to complete the installation, the following manual operations are required:");
foreach ($aManualSteps as $sModuleLabel => $sUrl) {
$oPage->p("
Manual instructions for $sModuleLabel");
}
$oPage->add("
Congratulations for installing ".ITOP_APPLICATION."
");
} else {
$oPage->add("
Congratulations for installing ".ITOP_APPLICATION."
");
$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('
Download '.basename($sBackupDestination).'');
} else {
$oPage->p('

Warning: Backup creation failed !');
}
}
// Form goes here.. No back button since the job is done !
$oPage->add('
');
$oPage->add("
");
$oPage->add("
");
$oPage->add("
");
$oPage->add('
');
$oPage->add('
');
$oConfig = new Config(utils::GetConfigFilePath());
$aParamValues = $this->oWizard->GetParamForConfigArray();
$oConfig->UpdateFromParams($aParamValues);
// Load the data model only, in order to load env-production/core/main.php to get the XML parameters (needed by GetModuleSettings below)
// But main.php may also contain classes (defined without any module), and thus requiring the full data model
// to be loaded to prevent "class not found" errors...
$oProductionEnv = new RunTimeEnvironment('production');
$oProductionEnv->InitDataModel($oConfig, true);
$sIframeUrl = $oConfig->GetModuleSetting('itop-hub-connector', 'setup_url', '');
$sSetupTokenFile = APPROOT.'data/.setup';
$sSetupToken = bin2hex(random_bytes(12));
file_put_contents($sSetupTokenFile, $sSetupToken);
$sIframeUrl .= "&setup_token=$sSetupToken";
if ($sIframeUrl != '') {
$oPage->add('