Conversation
# Executive summary This new plugin allow registration of a user only with an email address. If the plugin is enabled the username fields is not available in forms. As default also the name field isn’t available but this can be configured. # Backwards compatibility A problems can occur when a template overwrite has the changed one of the following views: * com_users/views/login/default_login.php * com_users/views/profile/default_core.php * com_users/views/registration/default.php Same is possible for the login module. A small problem can be if someone has a direct link to the „Username Reminder Request“ as we have in our test data. This doesn’t makes sense in this case. # Translation impact Two new language files with 8 new language tags. # Core changes * New User Plugin Event „onUserBeforeDataValidation“ * New User Plugin Event „onUserAfterDataValidation“ * New JForm Class method getFieldXml as public getter for the protected method findField * New parameter path for the setField method of JForm, allows to add a field at a specific place in the xml tree. All core changes are only additions and full B/C, even if the plugin isn’t accepted these changes allow more flexibility for JForm. # Testing instruction * Apply the patch * go to extensions and discover install the new plugin * enable the plugin * enable user registration 1) Test registration process 2) Test login 3) Test profile edit frontend 4) Test user data change backend
| PLG_USER_SIMPLIFY_EMAIL="Email (username)" | ||
| PLG_USER_SIMPLIFY_USERNAME="Email" | ||
| PLG_USER_SIMPLIFY_FIELD_REMOVENAME_DESC="Remove name field from forms." | ||
| PLG_USER__SIMPLIFY_FIELD_REMOVENAME_LABEL="Remove Name" |
There was a problem hiding this comment.
Why 2 underscores in this text name?
| PLG_USER_SIMPLIFY_USERNAME="Email" | ||
| PLG_USER_SIMPLIFY_FIELD_REMOVENAME_DESC="Remove name field from forms." | ||
| PLG_USER__SIMPLIFY_FIELD_REMOVENAME_LABEL="Remove Name" | ||
| PLG_USER_SIMPLIFY_XML_DESCRIPTION="Simplify the user registration, allows registration only with email address" |
There was a problem hiding this comment.
it would be better as
+PLG_USER_SIMPLIFY_XML_DESCRIPTION="Simplify the user registration process. This allows registration only with email address."
|
Made som en-GB suggestions inline This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10347. |
|
A very good idea... with a not so good name! |
|
|
||
| $plugin = JPluginHelper::getPlugin('user', 'simplify'); | ||
|
|
||
| $params = (new JRegistry)->loadString($plugin->params); |
There was a problem hiding this comment.
You've got PHP 5.4 code here
|
I made the suggested changes, thanks all for looking into it. I don't care so much about the name. Maybe @mikeveeckmans can make a suggestion with the marketing hat on. |
|
Are you sure a plugin is the correct approach here? Wouldn't it be better off as an option in com_users? |
|
@pe7er Are you not doing something similar? |
| $data['name'] = $value; | ||
| } | ||
|
|
||
| if ($this->params->get('remove_username_field', 1) == 1) |
There was a problem hiding this comment.
There is no option for "remove username field" in the plugin options we just have the first one
There was a problem hiding this comment.
Thanks for spotting this, I changed my mind and removed the option because you can simple disable the plugin to achieve the same
|
We need the languagetag change also for the com_joomlaupdate login view :) |
|
@SharkyKZ if you do it in com_user then you would simply allow the make some fields optional, that sounds easier but it is a big change that would effect also other extensions. The plugin just copies some data and does a bit of reordering fields. I think that is the minimalistic way to achieve the goal and has (hopefully) no side effects. @zero-24 not sure what you are talking about, I didn't made the SQL changes so that the plugin is part of the package, though before spending time on this I will make sure it goes in :-) |
|
hmm, a new plugin. You also have to modify the admin language/en-GB/install.xml |
|
Thanks for all the notes what I have to do but if nobody tests this it will go to nowhere :-) |
|
@rdeutz see: https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php Its a login view too so it needs to be catched here too. A test is on my todo list but it is not that easy on phone ;) We also need to add update SQL changes and the script php. Let me know if i should send it as pull request to your branch ;) |
|
I have tested this item 🔴 unsuccessfully on d71ee98 When the plugin is enabled, when the user is editing in back-end his profile the values of name and username are changed to the user email. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10347. |
|
Does this needs to be in the core. There are several extensions that already do this. |
|
@infograf768 that's expected behaviour. These fields aren't available, if I allow to change the username I can't really know how I should login someone. |
|
@rdeutz |
|
@infograf768 let me guess, username is now the same as you email, right? @brianteeman good question, I have seen one that does it over a special register form. It is not really the same |
|
As I said : the Name (It was Super User) and Username (was admin) are changed to the user email |
|
As I said: expected behaviour. You can't have both, register with only email/password and then login with a username |
|
Yes, this is why I say it is not B/C and vote against this plugin which can be enabled without the knowledge of its consequences. |
|
This is one on the JED. There may be more I can't really use the JED on my phone. http://extensions.joomla.org/extensions/extension/access-a-security/site-access/email-as-username |
|
Also I guess this is not suitable for any site that displays an author name. As with this plugin it would display the email address as the author. |
|
and not cloaked... |
|
@brianteeman you can enable the name field |
|
@roland-d Yeah, last week I was trying to write my own plugin to register with your Email address only. My reason was to lower the threshold to register at a website. My plugin would remove the Name, Username, 2nd Email + 1st Password + 2nd Password field. Username + Password would be generated by the plugin. I noticed that some events were missing and ran into problems sending the right data in the email notification. Having new events would make it much easier to change the registration form. |
|
@pe7er I though about removing the 2nd email/password fields. I also run into some problems with JForm and the fact that the validation runs on the request data (what makes 100% sense). If you check my code you will see I added new events and called it in the models. I might split this PR into 2, one with the non plugin code changes and another with the plugin itself. |
|
I don't like the fact, that com_users output looks explicit if this plugin is installed/activated. Because I have my own plugin which do something similar + split the name field. If I want to use this feature, I have to activate this plugin and override every change with my own. |
|
I wouldn't put such a plugin into core, but I think we should make the life easier for those who want to create such plugins. |
|
ok, let me spilt it. As long as we make these things possible I don't care if the plugin goes into core or not |
Also consider 3rd party extensions which display usernames instead of names. I've seen many of those. Perhaps add options to customize usernames (e.g. based on IDs, randomly generated, etc.). And then use actual email for authentication. In any case, I still think this should be a part of com_users rather than a separate plugin. |
Executive summary
This new plugin allow registration of a user only with an email address. If the plugin is enabled the username field is not available in forms. As default also the name field isn’t available but this can be configured.
Backwards compatibility
Problems can occur when a template overwrite has changed one of the following views:
Same is possible for the login module.
A small problem can be if someone has a direct link to the „Username Reminder Request“ as we have in our test data. This doesn’t makes sense in this configuration.
Translation impact
Two new language files with 8 new language tags.
Core changes
All core changes are only additions and full B/C, even if the plugin isn’t accepted these changes allow more flexibility for JForm.
Testing instruction