1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dotclear2_ynh.git synced 2024-09-03 18:26:29 +02:00

lowercase $user_id in ldap auth

This commit is contained in:
Kay0u 2022-01-07 19:20:34 +01:00
parent bb5f34686a
commit f2b7228a4a
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -22,6 +22,9 @@ class ldapDcAuth extends dcAuth
ldap_set_option ($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option ($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
if (ldap_bind($ds, "uid=".$user_id.",ou=users,".$this->base, $pwd)) if (ldap_bind($ds, "uid=".$user_id.",ou=users,".$this->base, $pwd))
{ {
# user_id needs to be in lowercase here
$user_id = strtolower($user_id);
# search the user in ldap, and get infos # search the user in ldap, and get infos
$filter = "(&(|(objectclass=posixAccount))(uid=".$user_id.")(permission=cn=__APP__.admin,ou=permission,".$this->base."))"; $filter = "(&(|(objectclass=posixAccount))(uid=".$user_id.")(permission=cn=__APP__.admin,ou=permission,".$this->base."))";
$sr = ldap_search($ds, $this->base, $filter, array("dn", "cn", "sn", "mail", "givenname")); # /!\ fields have to be in lowercase $sr = ldap_search($ds, $this->base, $filter, array("dn", "cn", "sn", "mail", "givenname")); # /!\ fields have to be in lowercase