Use a dedicated method to clear a wizard's session

Simplifies session removal in case a sub-class of Icinga\Web\Wizard
requires special session handling

refs #7163
This commit is contained in:
Johannes Meyer 2014-10-24 13:55:41 +02:00
parent a8dd9c933d
commit 03bbc2e2e6
2 changed files with 9 additions and 1 deletions

View File

@ -27,7 +27,7 @@ class SetupController extends ActionController
$installer = $wizard->getInstaller();
$success = $installer->run();
if ($success) {
$wizard->getSession()->clear();
$wizard->clearSession();
} else {
$wizard->setIsFinished(false);
}

View File

@ -407,6 +407,14 @@ class Wizard
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
*