I've combined several issues together into one patch:
- #351511: Switch to validation approach + hide username on edit page if username=email
- This patch changes the approach of the module. Instead of manipulating the database directly in
hook_user()for theinsertandupdatecases, this patch feeds the new username into the form on validate, and let's Drupal's native handling take care of the rest. This allows greater inter-operability in the workflow with other modules. - If the username is set to be equal to the email address per the flag on the admin page, then when users are allowed to edit their own username they should not see a separate username field. This patch checks for this in
hook_form_alter()in theuser_editcase, whichbreaks immediately if the flag is false but carries through touser_registercase if the flag is true. - And finally, I needed the super-admin (uid=1) to be able to pick the username without any interference from this module, so I just put in a quick check for that. Perhaps that can be made more customizable in the future, if you want the admin's username to remain the same as well?
- This patch changes the approach of the module. Instead of manipulating the database directly in
- #241909: No t() on login form
- A fairly simple and routine correction for missing
t()fucntions.
- A fairly simple and routine correction for missing
- #345399: Broken username when mail is missing from edit form...
- The change in approach from the first patch above (#351511: Switch to validation approach + hide username on edit page if username=email) actually takes care of this as well. I've been using patch #1 with advanced profile, node profile, etc-- the new approach is more inter-operable with other modules, especially the ones mentioned by sethcohn in this issue.
There is slight change in setting up the module now:
- One less obligation: This module's main page currently notes: "You will probably want to change the welcome e-mail (Administer -> User Management -> User Settings) and replace instances of the token !username with !mailto." This is no longer the case. This patch allows for normal "welcome!" emails from Drupal without any necessary changes.
- One new obligation: You must go to Administer -> User Management -> Access Control and allow authenticated users to change their own username. Otherwise, you'll get a validation error when users try to change their email address.
This is just for 5.x-1.x-dev release. I sadly don't have time to make a patch for 6.x.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | master.patch | 3.77 KB | sbandyopadhyay |
| master.patch | 3.92 KB | sbandyopadhyay |
Comments
Comment #1
sbandyopadhyay commentedErr... sorry, use this instead:
Comment #2
Christopher Herberte commentedThanks sbandyopadhyay, RTBC for 5.x
To port to 6.x
Comment #3
Christopher Herberte commentedpatch applied to head, leaving the issue open as it needs testing.
Comment #4
Christopher Herberte commented