Merge pull request #11964 from hregis/8.0_mc2

FIX getObjectSid is only for Active Directory
This commit is contained in:
Laurent Destailleur 2019-09-27 11:25:14 +02:00 committed by GitHub
commit 148afcaca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,9 +166,13 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
if ($ldapdebug) print "DEBUG: pwdLastSet = ".dol_print_date($ldap->pwdlastset, 'day')."<br>\n";
if ($ldapdebug) print "DEBUG: badPasswordTime = ".dol_print_date($ldap->badpwdtime, 'day')."<br>\n";
// On recherche le user dolibarr en fonction de son SID ldap
$sid = $ldap->getObjectSid($login);
if ($ldapdebug) print "DEBUG: sid = ".$sid."<br>\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."<br>\n";
}
$usertmp=new User($db);
$resultFetchUser=$usertmp->fetch('', $login, $sid);