I will have to add this functionality as part of work for my current employer, so I am assigning this feature request to myself.
- Add sections to the webserver_auth settings page for two bits of custom PHP code.
- Add a testing tab similar to admin/user/rules/check to the webserver_auth settings page.
- Modify webserver_auth.module to use custom PHP code from #1 above for username mangling.
- Modify webserver_auth.module to use custom PHP code from #1 above for setting new user data.
This is needed because our production environment involves a Apache 2 server running mod_auth_kerb, which does Basic Auth against a Kerberos server. However, the $_SERVER['REMOTE_USER'] usernames resemble "smithj1@EXAMPLE.COM" — not great for a production website. We have an LDAP server available that would allow me to map "smithj1@EXAMPLE.COM" to a real name ("John Smith") and also retrieve that user's e-mail address.
To do this in webserver_auth makes more sense than doing it in core (contentious, see #102679: Add a Display Name field to core in addition to Username) or in a theme (http://drupal.org/node/122303). Rather than hard-code all of this as a module that noone else will ever use, I propose to add some flexibility to webserver_auth so other site admins can implement their own solutions according to their situations, from within the Drupal interface.
Comments
Comment #1
moshe weitzman commentedThere is already a module_invoke_all("webserver_auth"); so you should be able to mangle there the name there. you might be able to use hook_user() to mangle other data. perhaps i could put a flaqg in $user object so you know that this user needs further mangling. not sure thats needed. you probably have to mangle all new users.
please reopen if this is not adequate.
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.