diff --git a/modules/setup/application/controllers/IndexController.php b/modules/setup/application/controllers/IndexController.php index a4d5076dd..9e9f5a6a0 100644 --- a/modules/setup/application/controllers/IndexController.php +++ b/modules/setup/application/controllers/IndexController.php @@ -79,7 +79,7 @@ class IndexController extends Controller $form = new Form(array( 'onSuccess' => function () { $wizard = new WebWizard(); - $wizard->clearSession(); + $wizard->clearSession(false); } )); $form->setUidDisabled(); diff --git a/modules/setup/library/Setup/WebWizard.php b/modules/setup/library/Setup/WebWizard.php index 82a7ca5b7..66e103bee 100644 --- a/modules/setup/library/Setup/WebWizard.php +++ b/modules/setup/library/Setup/WebWizard.php @@ -380,15 +380,19 @@ class WebWizard extends Wizard implements SetupWizard } /** - * Clear the session being used by this wizard and drop the setup token + * Clear the session being used by this wizard + * + * @param bool $removeToken If true, the setup token will be removed */ - public function clearSession() + public function clearSession($removeToken = true) { parent::clearSession(); - $tokenPath = Config::resolvePath('setup.token'); - if (file_exists($tokenPath)) { - @unlink($tokenPath); + if ($removeToken) { + $tokenPath = Config::resolvePath('setup.token'); + if (file_exists($tokenPath)) { + @unlink($tokenPath); + } } }