first_name taken from incorrect attribute 'cn'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SchoolTool LDAP |
New
|
Undecided
|
Unassigned |
Bug Description
A user's name was bing displayed as "First Last Last" after login with LDAP credentials.
Looking at "ldap/security.py" shows that first_name is being taken from "cn" attribute,
http://
"The 'cn' ('commonName' in X.500) attribute type contains names of an
object. Each name is one value of this multi-valued attribute. If
the object corresponds to a person, it is typically the person's full
name."
The appropriate attribute is "givenName":
"The 'givenName' attribute type contains name strings that are the
part of a person's name that is not their surname."
I suggest adding "givenName" to the "all_attrs" list, and substituting
"givenName" for "cn" in the "first_name" assignment.
class PersonLDAPPerso
all_attrs = (
'sn', # surname
'cn', # common name
def __init__(self, *args, **kw):
def oneline(self, t):
if not t:
return u''
return u' '.join(
def update(self):
# 'first_name': self.oneline(
})
})