From 4f7672b85b656c1b8bc51442ac403313a8ac0973 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Fri, 1 Jan 2016 09:51:50 +0100 Subject: [PATCH] baculum: Fix auto-login after finishing wizard --- gui/baculum/protected/Pages/Home.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gui/baculum/protected/Pages/Home.php b/gui/baculum/protected/Pages/Home.php index f24d8841d4..24fd24d07c 100644 --- a/gui/baculum/protected/Pages/Home.php +++ b/gui/baculum/protected/Pages/Home.php @@ -42,6 +42,23 @@ class Home extends BaculumPage public $windowIds = array('Storage', 'Client', 'Volume', 'Pool', 'Job', 'JobRun'); + public function onPreInit($param) { + parent::onPreInit($param); + if (!$this->IsPostBack && !$this->IsCallBack) { + /** + * Reload page if refresh_page written in session. + * Useful in login and re-login (back from wizards). + * Otherwise HTTP Basic login prompt occurs. + */ + if (array_key_exists('refresh_page', $_SESSION)) { + $refresh_page = $_SESSION['refresh_page']; + header('Location: ' . $refresh_page); + unset($_SESSION['refresh_page']); + exit(); + } + } + } + public function onInit($param) { parent::onInit($param); $this->Application->getModule('users')->loginUser(); -- 2.39.5