Merge pull request #18724 from ibuiv/patch-1

Fix ldap passw bug with activedirectory
This commit is contained in:
Laurent Destailleur 2021-09-17 10:54:05 +02:00 committed by GitHub
commit 6a73fc6e44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -486,6 +486,11 @@ class Ldap
// For better compatibility with Samba4 AD
if ($this->serverType == "activedirectory") {
unset($info['cn']); // To avoid error : Operation not allowed on RDN (Code 67)
// To avoid error : LDAP Error: 53 (Unwilling to perform)
if (isset($info['unicodePwd'])) {
$info['unicodePwd'] = mb_convert_encoding("\"".$info['unicodePwd']."\"", "UTF-16LE", "UTF-8");
}
}
$result = @ldap_modify($this->connection, $dn, $info);