Using LDAP we found a very odd behavior: the mail field is not mandatory in our LDAP schema, and some accounts don't have a mail value.
Searching for a bit in code and configuration, I found out that we can configure email behavior with:
LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_ENABLE_NOTIFY
LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_ENABLE
LDAP_AUTHENTICATION_EMAIL_UPDATE_ON_LDAP_CHANGE_DISABLE
The problem for us that the second constant is fine, but sometime, mail from LDAP being empty, we don't want it to change, because Drupal needs an email value, and without it will generate a whole lot of errors. What needs to the LDAP module is another option for the empty mail behavior with something such as:
When LDAP mail attribute is empty:
- Do not update user account mail property
- Generate a fake existing mail address [with token?] such as md5(USERNAME)-nonexisting@localhost.localdomain
- Update user account following "Email Update" configured rule, let the field become empty (will generate a lot of Drupal errors).
I consider this as a bug, because it's legit to have an empty mail field coming in, and leaving it empty will make Drupal generate a lot of PHP warnings and errors.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | ldap-1.x-beta12-empty_mail_behavior.patch | 5.36 KB | pounard |
Comments
Comment #1
pounardHere is a sample patch (needs deeper testing) I made quickly. This is an SVN made patch (sorry, I don't have a choice here) so if you want to test you'll need to either apply it using the patch command:
That should work.
Comment #2
johnbarclay commentedThis is a duplicate of #1321258: LDAP Authentication: Allow entering of email on initial logon before acct created and editing of email afterward. It applies to 7.x-1.x and 7.x-2.x. I'm marking this as a duplicate since the discussion is farther allong on that issue.
Comment #3
pounardOh ok, sorry I searched but didn't find the other issue! Thanks for answering. I hope a solution will be found out quickly.