From 2c73c19bd5340f61a1b160f44964b094d7ad1a1c Mon Sep 17 00:00:00 2001 From: antonin_tdj <50403308+ibuiv@users.noreply.github.com> Date: Wed, 15 Sep 2021 18:26:32 +0200 Subject: [PATCH] fix ldap passw bug with activedirectory Fix to avoid LDAP Error: 53 (Unwilling to perform) on Samba4 AD --- htdocs/core/class/ldap.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 0e8fd3ee7b4..eb4f200f5fd 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -486,6 +486,7 @@ 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) } $result = @ldap_modify($this->connection, $dn, $info);