From: Marcin Haba Date: Fri, 1 Jan 2016 08:51:50 +0000 (+0100) Subject: baculum: Fix auto-login after finishing wizard X-Git-Tag: Release-7.4.0~52 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4f7672b85b656c1b8bc51442ac403313a8ac0973;p=bacula%2Fbacula baculum: Fix auto-login after finishing wizard --- 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();