From 3108593c8b647f8053caf978af337679eff542b5 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Fri, 1 Jan 2016 09:50:38 +0100 Subject: [PATCH] baculum: Check if auth data exists before log in try --- gui/baculum/protected/Class/BaculumUsersManager.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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']); } -- 2.39.5