N°3952 - code hardening (merged from support/2.6)

This commit is contained in:
Eric
2021-05-27 09:55:16 +02:00
5 changed files with 54 additions and 21 deletions

View File

@@ -105,7 +105,7 @@ class WizardController
/**
* Starts the wizard by displaying it in its initial state
*/
protected function Start()
public function Start()
{
$sCurrentStepClass = $this->sInitialStepClass;
$oStep = new $sCurrentStepClass($this, $this->sInitialState);
@@ -121,7 +121,7 @@ class WizardController
$sCurrentState = utils::ReadParam('_state', $this->sInitialState);
/** @var \WizardStep $oStep */
$oStep = new $sCurrentStepClass($this, $sCurrentState);
if ($oStep->ValidateParams($sCurrentState))
if ($oStep->ValidateParams())
{
$this->PushStep(array('class' => $sCurrentStepClass, 'state' => $sCurrentState));
$aPossibleSteps = $oStep->GetPossibleSteps();
@@ -174,7 +174,7 @@ class WizardController
if (!is_writable($sConfigFile))
{
SetupUtils::ExitReadOnlyMode(false); // Reset readonly mode in case of problem
SetupUtils::EraseSetupToken();
$sRelativePath = utils::GetConfigFilePathRelative();
$oP = new SetupPage('Installation Cannot Continue');
$oP->add("<h2>Fatal error</h2>\n");
@@ -182,7 +182,8 @@ class WizardController
$oP->p("The wizard cannot modify the configuration file for you. If you want to upgrade ".ITOP_APPLICATION.", make sure that the file '<b>".$sRelativePath."</b>' can be modified by the web server.");
$oP->p('<button type="button" onclick="window.location.reload()">Reload</button>');
$oP->output();
return;
// Prevent token creation
exit;
}
}
}