From: Sébastien NOBILI Date: Wed, 3 Jun 2020 08:34:32 +0000 (+0200) Subject: Update application/security/LoginManager.php X-Git-Tag: v0.12.0-beta~7^2~3 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=21e5df5ee8f302ab96d4ca46ac3070405dd9aafb;p=github%2Fshaarli%2FShaarli.git Update application/security/LoginManager.php Co-authored-by: ArthurHoaro --- diff --git a/application/security/LoginManager.php b/application/security/LoginManager.php index 2cea3f10..16ef3878 100644 --- a/application/security/LoginManager.php +++ b/application/security/LoginManager.php @@ -147,8 +147,10 @@ class LoginManager // Check credentials try { - if (($this->configManager->get('ldap.host') != "" && $this->checkCredentialsFromLdap($login, $password)) - || ($this->configManager->get('ldap.host') == "" && $this->checkCredentialsFromLocalConfig($login, $password))) { + $useLdapLogin = !empty($this->configManager->get('ldap.host')); + if ((false === $useLdapLogin && $this->checkCredentialsFromLocalConfig($login, $password)) + || (true === $useLdapLogin && $this->checkCredentialsFromLdap($login, $password)) + ) { $this->sessionManager->storeLoginInfo($clientIpId); logm( $this->configManager->get('resource.log'),