From 03bbc2e2e61c7848314af71bd1cc7257b37e7bd8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 24 Oct 2014 13:55:41 +0200 Subject: [PATCH] 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 --- application/controllers/SetupController.php | 2 +- library/Icinga/Web/Wizard.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/application/controllers/SetupController.php b/application/controllers/SetupController.php index 3b59e266f..b491446e0 100644 --- a/application/controllers/SetupController.php +++ b/application/controllers/SetupController.php @@ -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); } diff --git a/library/Icinga/Web/Wizard.php b/library/Icinga/Web/Wizard.php index db81d497e..a1c18ab4b 100644 --- a/library/Icinga/Web/Wizard.php +++ b/library/Icinga/Web/Wizard.php @@ -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 *