From: Marcin Haba Date: Fri, 1 Jan 2016 08:50:38 +0000 (+0100) Subject: baculum: Check if auth data exists before log in try X-Git-Tag: Release-7.4.0~53 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3108593c8b647f8053caf978af337679eff542b5;p=bacula%2Fbacula baculum: Check if auth data exists before log in try --- diff --git a/gui/baculum/protected/Class/BaculumUsersManager.php b/gui/baculum/protected/Class/BaculumUsersManager.php index cb7a08862d..a87ddf3f45 100644 --- a/gui/baculum/protected/Class/BaculumUsersManager.php +++ b/gui/baculum/protected/Class/BaculumUsersManager.php @@ -27,12 +27,10 @@ class BaculumUsersManager extends TModule implements IUserManager { private $config; private $configMod; - private $users; public function init($config) { $this->configMod = $this->Application->getModule('configuration'); $this->config = $this->configMod->isApplicationConfig() ? $this->configMod->getApplicationConfig() : null; - $this->users = $this->configMod->getAllUsers(); } public function getGuestName() { @@ -55,7 +53,8 @@ class BaculumUsersManager extends TModule implements IUserManager { $user->setID($id); $user->setName($username); if (!is_null($username)) { - $user->setPwd($this->users[$username]); + $users = $this->configMod->getAllUsers(); + $user->setPwd($users[$username]); } if(is_null($this->config) || $this->config['baculum']['login'] === $username) { $user->setRoles('admin'); @@ -90,7 +89,7 @@ class BaculumUsersManager extends TModule implements IUserManager { } public function loginUser($user = null, $pwd = null) { - if (is_null($user) && is_null($pwd)) { + if (is_null($user) && is_null($pwd) && isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { $user = $_SERVER['PHP_AUTH_USER']; $pwd = $this->Application->getModule('configuration')->getCryptedPassword($_SERVER['PHP_AUTH_PW']); }