- Change Summary:
-
Tagged with bug.
- Bugs:
Update LDAP account sync to allow for more flexibility in name attributes.
Review Request #2389 — Created June 1, 2011 and submitted
Added the following LDAP options: * LDAP_GIVEN_NAME_ATTRIBUTE * LDAP_SURNAME_ATTRIBUTE * LDAP_FULL_NAME_ATTRIBUTE While comments made in http://reviews.reviewboard.org/r/399/ are true (sn and givenName are "standard"), they're not required or mandated to use the same naming conventions. They are listed as "good practice" and "acceptable" in the related RFCs but are up to the whim of the sysadmin building the system. Because of this, having flexibility is beneficial. None of these fields are required and the Full Name Attribute will always be ignored if a response is given for Given Name or Surname.
Tested against LDAP dev LDAP server with long names (greate than two) and changing name attributes for first_name and last_name.
JU
-
-
Might be better like: given_name_attr = settings.LDAP_GIVEN_NAME_ATTRIBUTE or 'givenName' first_name = user_info.get(given_name_attr, [username])[0]
-
-
-
-
What are these showing when using defaults? Just empty? Maybe instead, these should default to "givenName" and stuff, which would simplify the logic above?
JU
- Change Summary:
-
This is why one should sleep before submitting code after long days... Vastly simplified the change and tested with multiple cases: * bad/missing attribute for given name * bad/missing attribute for surname * single entry for full name Full Name Attribute now takes precedence.