Skip to content

Commit

Permalink
WebWizard: Add removeToken option to method clearSession
Browse files Browse the repository at this point in the history
refs #9658
  • Loading branch information
N-o-X committed Dec 22, 2016
1 parent 9164e40 commit dd09ee5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/setup/application/controllers/IndexController.php
Expand Up @@ -79,7 +79,7 @@ public function restartAction()
$form = new Form(array(
'onSuccess' => function () {
$wizard = new WebWizard();
$wizard->clearSession();
$wizard->clearSession(false);
}
));
$form->setUidDisabled();
Expand Down
14 changes: 9 additions & 5 deletions modules/setup/library/Setup/WebWizard.php
Expand Up @@ -380,15 +380,19 @@ protected function addButtons(Form $page)
}

/**
* 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);
}
}
}

Expand Down

0 comments on commit dd09ee5

Please sign in to comment.