From ffe866f96f96c79ba81433a2b7ba21e8050ba003 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 25 Sep 2019 19:24:07 +0200 Subject: [PATCH] FIX getObjectSid is only for Active Directory --- htdocs/core/login/functions_ldap.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index d468c882b2d..2afe2f00340 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -164,9 +164,13 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) if ($ldapdebug) print "DEBUG: pwdLastSet = ".dol_print_date($ldap->pwdlastset,'day')."
\n"; if ($ldapdebug) print "DEBUG: badPasswordTime = ".dol_print_date($ldap->badpwdtime,'day')."
\n"; - // On recherche le user dolibarr en fonction de son SID ldap - $sid = $ldap->getObjectSid($login); - if ($ldapdebug) print "DEBUG: sid = ".$sid."
\n"; + // On recherche le user dolibarr en fonction de son SID ldap (only for Active Directory) + $sid = null; + if ($conf->global->LDAP_SERVER_TYPE == "activedirectory") + { + $sid = $ldap->getObjectSid($login); + if ($ldapdebug) print "DEBUG: sid = ".$sid."
\n"; + } $usertmp=new User($db); $resultFetchUser=$usertmp->fetch('',$login,$sid);