]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Fix working logout button
authorMarcin Haba <marcin.haba@bacula.pl>
Mon, 19 Jun 2017 19:15:31 +0000 (21:15 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Mon, 19 Jun 2017 19:16:23 +0000 (21:16 +0200)
gui/baculum/protected/Web/Pages/WebHome.page
gui/baculum/protected/Web/Pages/WebHome.php

index 0c1a89b68ea9127509b6361dd6781980b2ac4897..d2b8c60fb310f96f52efe3f1746ceda72b2f7e89 100644 (file)
@@ -17,7 +17,7 @@
                                <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/config.png" alt="" onclick="$('#<%=$this->Config->ClientID%>').click()" />
                                <com:TActiveLinkButton ID="Config" Text="<%[ Configuration ]%>" Attributes.onclick="PanelWindow.show('config'); return false;" />
                                <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/logout.png" alt="" onclick="$('#<%=$this->Logout->ClientID%>').click()" />
-                               <com:TActiveLinkButton ID="Logout" Text="<%[ Logout ]%>" OnClick="logout" ClientSide.OnComplete="document.location.href = document.location.protocol + '//' + document.location.host;" />
+                               <com:TActiveLinkButton ID="Logout" Text="<%[ Logout ]%>" OnCommand="Page.logout" />
                        </div>
                <com:Application.Web.Portlets.TrayBar ID="TrayBar" />
                </div>
index 5f911962b611448d8ba1c32ce8a870e7de5ed7df..4e2936516bbd75d4f64ecca3270c843ec31b21a4 100644 (file)
@@ -232,9 +232,8 @@ class WebHome extends BaculumWebPage
        }
 
        public function logout($sender, $param) {
-               $http_protocol = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) ? 'https' : 'http';
-               $fake_pwd = $this->getModule('web_config')->getRandomString();
-               $this->switchToUser($http_protocol, $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $this->User->getName(), $fake_pwd);
+               $fake_pwd = $this->getModule('misc')->getRandomString();
+               $this->switchToUser($this->User->getName(), $fake_pwd);
                exit();
        }
 }