From: Marcin Haba Date: Tue, 19 May 2020 18:28:53 +0000 (+0200) Subject: baculum: Tweak improve logout basic auth user X-Git-Tag: Release-9.6.4~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=049fa62f916907ad940798c4549a2ca0d45ebf79;p=thirdparty%2Fbacula.git baculum: Tweak improve logout basic auth user --- diff --git a/gui/baculum/protected/Web/Pages/LoginPage.php b/gui/baculum/protected/Web/Pages/LoginPage.php index 76132dbf9..2515f291d 100644 --- a/gui/baculum/protected/Web/Pages/LoginPage.php +++ b/gui/baculum/protected/Web/Pages/LoginPage.php @@ -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); diff --git a/gui/baculum/protected/Web/Portlets/MainSideBar.php b/gui/baculum/protected/Web/Portlets/MainSideBar.php index ac43a1a17..30c10b43a 100644 --- a/gui/baculum/protected/Web/Portlets/MainSideBar.php +++ b/gui/baculum/protected/Web/Portlets/MainSideBar.php @@ -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);