]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Fix auto-login after finishing wizard
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 1 Jan 2016 08:51:50 +0000 (09:51 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Fri, 1 Jan 2016 11:39:18 +0000 (12:39 +0100)
gui/baculum/protected/Pages/Home.php

index f24d8841d478d0804cf103a121a4e5ec311277dc..24fd24d07cd94917ced815dd4a06fbe64baf5504 100644 (file)
@@ -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();