]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Update application/security/LoginManager.php
authorSébastien NOBILI <s-code-github@pipoprods.org>
Wed, 3 Jun 2020 08:34:32 +0000 (10:34 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Jun 2020 08:34:32 +0000 (10:34 +0200)
Co-authored-by: ArthurHoaro <arthur@hoa.ro>
application/security/LoginManager.php

index 2cea3f1083434e8b1a3ec21f919d42ad66fb1c4b..16ef3878ca24c64d430a13dbbf136df82d251cf4 100644 (file)
@@ -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'),