LDAP auth backend assumes things about how first and last names can be gathered.

Review Request #399 — Created May 27, 2008 and submitted

Information

Review Board SVN (deprecated)

Reviewers

first_name and last_name are gathered (currently) by space-splitting the 'cn' field. This is correct unless you don't have spaces in your 'cn' field at which point user creation fails.

I have switched to using displayName, but this is not a permanent fix. I might recommend something similar to LDAP_UID_MASK, but it is not likely as simple.
I tested this on my server by logging in with an unregistered user using the LDAP backend. The user creation was successful.
chipx86
  1. 
      
  2. trunk/reviewboard/accounts/backends.py (Diff revision 1)
     
     
    Are we guaranteed to have a displayName variable with spaces? Can this have the same problem as cn?
    1. IIRC, we should really be pulling first name from the 'givenName' field and the last name from the 'sn' (surname) field.
      
      Thoughts?
    2. I don't know LDAP well enough. If that's standard and we can rely on it, sure.
    3. Looks like it's a standard.  I'll make this change and submit it.
  3.