Avoir Error 19 Constraint Violation (in case of password unchanged)

This commit is contained in:
antonin_tdj 2021-09-16 09:31:00 +02:00 committed by GitHub
parent 2c73c19bd5
commit 8c1b3efc47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -486,7 +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)
$info['unicodePwd'] = mb_convert_encoding("\"".$info['unicodePwd']."\"", "UTF-16LE", "UTF-8"); // To avoid error : LDAP Error: 53 (Unwilling to perform)
// 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);