Skip to content

Commit

Permalink
Use a dedicated method to clear a wizard's session
Browse files Browse the repository at this point in the history
Simplifies session removal in case a sub-class of Icinga\Web\Wizard
requires special session handling

refs #7163
  • Loading branch information
Johannes Meyer committed Oct 24, 2014
1 parent a8dd9c9 commit 03bbc2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion application/controllers/SetupController.php
Expand Up @@ -27,7 +27,7 @@ public function indexAction()
$installer = $wizard->getInstaller();
$success = $installer->run();
if ($success) {
$wizard->getSession()->clear();
$wizard->clearSession();
} else {
$wizard->setIsFinished(false);
}
Expand Down
8 changes: 8 additions & 0 deletions library/Icinga/Web/Wizard.php
Expand Up @@ -407,6 +407,14 @@ public function getSession()
return Session::getSession()->getNamespace(get_class($this));
}

/**
* Clear the session being used by this wizard
*/
public function clearSession()
{
$this->getSession()->clear();
}

/**
* Add buttons to the given page based on its position in the page-chain
*
Expand Down

0 comments on commit 03bbc2e

Please sign in to comment.