Download & Extend

LDAP: Class LdapServer method: deriveEmailFromEntry

Project:Lightweight Directory Access Protocol (LDAP)
Version:7.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:thomas.borrmann
Status:closed (cannot reproduce)

Issue Summary

at LdapServer->deriveEmailFromEntry($ldap_entry) {...} on line #815: the function returns the value from array $ldap_entry whichs key is mapped to the LDAP record entry for email address. While this key is in lower case, the function looks up for a camelcase name that is stored in $this->mail_attr (here: userPrincipalName vs. userprincipalname). Therefor the function returns an empty value - the login procedure fails with the following error message:
"Another user already exists in the system with the same email address ...", new users cannot log in.

As a workaround I changed line 815 from
return @$ldap_entry[$this->mail_attr][0];
to
return @$ldap_entry[strtolower($this->mail_attr)][0];
and it works fine.

Comments

#1

Status:active» fixed

thanks. this is committed. I did it a little differently because I'm trying to run all the case conversions through a single function. More for accounting and change management than anything. Here's the line:

return @$ldap_entry[ldap_server_massage_text($this->mail_attr, 'attr_name', LDAP_SERVER_MASSAGE_QUERY_ARRAY)][0];

#2

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#3

Version:7.x-1.0-beta10» 7.x-2.x-dev
Status:closed (fixed)» active

I am reopening this issue and changing the version to 7.x-2.x-dev as I see this problem on the 2.x series as well (using userPrincipalName for mail attribute).

#4

Does this problem still exist in the current 7.x-2.x-dev?

#5

Status:active» postponed (maintainer needs more info)

Anyone still running across this in the 7.x-2.x branch. This has simpletest coverage, but not sure how compete it is.

#6

Status:postponed (maintainer needs more info)» closed (cannot reproduce)