mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°2249 - Supportability - Updater module (Allow to run setup in case of failure)
This commit is contained in:
@@ -26,8 +26,6 @@ require_once(APPROOT.'/setup/wizardcontroller.class.inc.php');
|
||||
require_once(APPROOT.'/setup/wizardsteps.class.inc.php');
|
||||
|
||||
clearstatcache(); // Make sure we know what we are doing !
|
||||
SetupUtils::ExitMaintenanceMode(false); // Reset maintenance mode in case of problem
|
||||
SetupUtils::ExitReadOnlyMode(false); // Reset readonly mode in case of problem
|
||||
// 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')));
|
||||
// While running the setup it is desirable to see any error that may happen
|
||||
|
||||
@@ -2030,15 +2030,22 @@ JS
|
||||
/**
|
||||
* Verify Setup authentication token (from the request parameter 'authent')
|
||||
*
|
||||
* @param bool $bRemoveToken
|
||||
*
|
||||
* @throws \SecurityException
|
||||
*/
|
||||
public final static function CheckSetupToken()
|
||||
public final static function CheckSetupToken($bRemoveToken = false)
|
||||
{
|
||||
$sAuthent = utils::ReadParam('authent', '', false, 'raw_data');
|
||||
if (!file_exists(APPROOT.'data/setup/authent') || $sAuthent !== file_get_contents(APPROOT.'data/setup/authent'))
|
||||
$sTokenFile = APPROOT.'data/setup/authent';
|
||||
if (!file_exists($sTokenFile) || $sAuthent !== file_get_contents($sTokenFile))
|
||||
{
|
||||
throw new SecurityException('Setup operations are not allowed outside of the setup');
|
||||
}
|
||||
if ($bRemoveToken)
|
||||
{
|
||||
@unlink($sTokenFile);
|
||||
}
|
||||
}
|
||||
|
||||
private final static function Log($sText)
|
||||
|
||||
@@ -173,6 +173,9 @@ class WizardController
|
||||
// The configuration file already exists
|
||||
if (!is_writable($sConfigFile))
|
||||
{
|
||||
SetupUtils::ExitMaintenanceMode(false); // Reset maintenance mode in case of problem
|
||||
SetupUtils::ExitReadOnlyMode(false); // Reset readonly mode in case of problem
|
||||
|
||||
$sRelativePath = utils::GetConfigFilePathRelative();
|
||||
$oP = new SetupPage('Installation Cannot Continue');
|
||||
$oP->add("<h2>Fatal error</h2>\n");
|
||||
@@ -643,4 +646,4 @@ class Step3 extends WizardStep
|
||||
}
|
||||
}
|
||||
|
||||
End of the example */
|
||||
End of the example */
|
||||
|
||||
Reference in New Issue
Block a user