Support LDAP schemes with no mail attribute
|Assignee:||Andreas Schröder||% Done:|
If an LDAP user exists, but the profile is not setup in the database, line 83 of app/models/profile.rb wants a mail= from my filtered LDAP result. I don't have a mail attribute on my users. The manager that I'm using doesn't allow me to add that attribute. So - I changed config/environment.rb so that it looks like below:
ENV['LDAP_FILTER'] ||= "uid"
ENV['LDAP_ATTRS'] ||= "cn"
(I took out the mail ATTR). Seemed logical. Only problem was - then it tried to still SET myprofile.email on line 67 of app/models/profile.rb.
myprofile.email = entry.mail.to_s.chars
only call entry.mail IF that is an ATTR in the config/environment.rb