From a2b60e52e95ca02d7c8fd1e90b78ffd67ad87190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20M=C3=BCller?= Date: Thu, 31 Mar 2022 09:36:58 +0200 Subject: [PATCH] core/login/ldap: allow anonymous user lookup --- htdocs/core/login/functions_ldap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 1db98f5384e..1d86bd19549 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -109,9 +109,9 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $userSearchFilter = str_replace('%1%', $usertotest, $dolibarr_main_auth_ldap_filter); } - // If admin login provided + // If admin login or ldap auth filter provided // Code to get user in LDAP from an admin connection (may differ from user connection, done later) - if ($ldapadminlogin) { + if ($ldapadminlogin || $dolibarr_main_auth_ldap_filter) { $result = $ldap->connect_bind(); if ($result > 0) { $resultFetchLdapUser = $ldap->fetch($usertotest, $userSearchFilter);