]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Tweak improve logout basic auth user
authorMarcin Haba <marcin.haba@bacula.pl>
Tue, 19 May 2020 18:28:53 +0000 (20:28 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Tue, 19 May 2020 18:46:11 +0000 (20:46 +0200)
gui/baculum/protected/Web/Pages/LoginPage.php
gui/baculum/protected/Web/Portlets/MainSideBar.php

index 76132dbf9961381ea21b59a3e4f623f7f2ca2601..2515f291d59aeda2e4282b7325121d9333e81b4e 100644 (file)
@@ -40,7 +40,8 @@ class LoginPage extends BaculumWebPage {
                parent::onInit($param);
                if ($this->getModule('web_config')->isAuthMethodBasic()) {
                        $fake_pwd = $this->getModule('crypto')->getRandomString();
-                       $user = $_SERVER['PHP_AUTH_USER'] . '1'; // must be different than currently logged in Basic user
+                       // must be different than currently logged in Basic user
+                       $user = (isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : '') . '1';
 
                        // do a login try with different user and password to logout current user
                        $this->reload_url = $this->getPage()->getFullLoginUrl($user, $fake_pwd);
index ac43a1a17646c0a906f4a4e401c5d87211245930..30c10b43ad3ff5dac2f8302147af329b94016ac0 100644 (file)
@@ -41,7 +41,8 @@ class MainSideBar extends Portlets {
                parent::onInit($param);
                if ($this->getModule('web_config')->isAuthMethodBasic()) {
                        $fake_pwd = $this->getModule('crypto')->getRandomString();
-                       $user = $_SERVER['PHP_AUTH_USER'] . '1'; // must be different than currently logged in Basic user
+                       // must be different than currently logged in Basic user
+                       $user = (isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : '') . '1';
 
                        // do a login try with different user and password to logout current user
                        $this->reload_url = $this->getPage()->getFullLoginUrl($user, $fake_pwd);