From a230fd4aa8d205ea19fff789954a02755b093ac0 Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Thu, 22 Dec 2016 14:18:38 +0100 Subject: [PATCH] WebWizard: Add removeToken option to method clearSession refs #9658 --- .../application/controllers/IndexController.php | 2 +- modules/setup/library/Setup/WebWizard.php | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) 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); + } } }