mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°3952 - code hardening (merged from support/2.6)
This commit is contained in:
@@ -25,6 +25,7 @@ require_once(APPROOT.'/setup/setuppage.class.inc.php');
|
||||
require_once(APPROOT.'/setup/wizardcontroller.class.inc.php');
|
||||
require_once(APPROOT.'/setup/wizardsteps.class.inc.php');
|
||||
|
||||
session_start();
|
||||
clearstatcache(); // Make sure we know what we are doing !
|
||||
// Set a long (at least 4 minutes) execution time for the setup to avoid timeouts during this phase
|
||||
ini_set('max_execution_time', max(240, ini_get('max_execution_time')));
|
||||
@@ -33,21 +34,17 @@ ini_set('display_errors', true);
|
||||
ini_set('display_startup_errors', true);
|
||||
date_default_timezone_set('Europe/Paris'); // Just to avoid a warning if the timezone is not set in php.ini
|
||||
|
||||
SetupUtils::ExitMaintenanceMode(false);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Fake functions to protect the first run of the installer
|
||||
// in case the PHP JSON module is not installed...
|
||||
if (!function_exists('json_encode'))
|
||||
{
|
||||
if (!function_exists('json_encode')) {
|
||||
function json_encode($value, $options = null)
|
||||
{
|
||||
return '[]';
|
||||
}
|
||||
}
|
||||
if (!function_exists('json_decode'))
|
||||
{
|
||||
function json_decode($json, $assoc=null)
|
||||
if (!function_exists('json_decode')) {
|
||||
function json_decode($json, $assoc = null)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
@@ -57,4 +54,13 @@ if (!function_exists('json_decode'))
|
||||
//N°3671 setup context: force $bForceTrustProxy to be persisted in next calls
|
||||
utils::GetAbsoluteUrlAppRoot(true);
|
||||
$oWizard = new WizardController('WizStepWelcome');
|
||||
$oWizard->Run();
|
||||
//N°3952
|
||||
if (SetupUtils::IsSessionSetupTokenValid()) {
|
||||
// Normal operation
|
||||
$oWizard->Run();
|
||||
} else {
|
||||
SetupUtils::ExitMaintenanceMode(false);
|
||||
// Force initializing the setup
|
||||
$oWizard->Start();
|
||||
SetupUtils::CreateSetupToken();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user