? Success
Pull Request for # 5556

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
3 Jan 2015

Code from #5556 wrapped up in a easy to test/merge Pull request

To test -

1) Set "Send Password" in User Options to YES - Register a new user - You should get an email!
2) Set "Send Password" in User Options to NO - Register a new user - You should NOT get an email!

avatar PhilETaylor PhilETaylor - open - 3 Jan 2015
avatar jissues-bot jissues-bot - change - 3 Jan 2015
Labels Added: ?
avatar PhilETaylor PhilETaylor - test_item - 3 Jan 2015 - Tested successfully
avatar brianteeman brianteeman - change - 3 Jan 2015
Rel_Number 5556
Relation Type Pull Request for
avatar zero-24
zero-24 - comment - 3 Jan 2015

@PhilETaylor

can you make travis happy?

FILE: ...is/build/joomla/joomla-cms/components/com_users/models/registration.php
--------------------------------------------------------------------------------
FOUND 8 ERROR(S) AFFECTING 8 LINE(S)
--------------------------------------------------------------------------------
 510 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 511 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 512 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 513 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 514 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 515 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 516 | ERROR | Tabs must be used to indent lines; spaces are not allowed
 517 | ERROR | Tabs must be used to indent lines; spaces are not allowed
--------------------------------------------------------------------------------

https://travis-ci.org/joomla/joomla-cms/jobs/45735524

avatar PhilETaylor
PhilETaylor - comment - 3 Jan 2015

I was waiting for it to fail so I could fix it :)

avatar zero-24
zero-24 - comment - 3 Jan 2015

@PhilETaylor can you add one more Tab per line so we have all agline?

Travis not liking spaces... can never work out which it should be tab...

It is because of the Joomla codestyle rules. :smile: It makes the code better to read and understand. Also you can better style your code with tabs than with spaces. :smile:

avatar PhilETaylor
PhilETaylor - comment - 3 Jan 2015

My editor is set up for my custom code style at the moment, you should see what it did to the code when I auto rearrange/formatted :-) :-)

In phpStorm they are all tabs and all lined up right

This time I edited using github editor inline, and used tabs, lets hope once the build is complete it likes that

Is there a phpStorm Code Style definition file I can download and import?

avatar PhilETaylor
PhilETaylor - comment - 3 Jan 2015

found the link I was looking for now - thanks - https://docs.joomla.org/Joomla_CodeSniffer#Installing_Joomla_Code_style

avatar PhilETaylor
PhilETaylor - comment - 3 Jan 2015

Excellent - all passing now :)

avatar brianteeman brianteeman - change - 3 Jan 2015
Category Authentication
avatar wilsonge
wilsonge - comment - 3 Jan 2015

We should probably check the plugin is enabled (https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/plugin/helper.php#L126)? If not then maybe still always send the email (not sure on that latter bit)

avatar joomdonation
joomdonation - comment - 3 Jan 2015

I want to point out somethings here:

  1. It seems the plugin "User - Joomla!" was designed to send emails to users only when these users are created from back-end of the site by administrator. So maybe the param "Notification Mail to User" should not affect the front-end registration?

  2. If we want to allow disable sending emails to users in front-end registration, maybe introduce a new parameter to Users component options, same as "Notification Mail to Administrators" param which we are having right now ?

  3. If we decide to go with this change, maybe we should change the tooltip of the parameter "Notification Mail to User", too. Right now, it is "When an administrator creates a user account, this determines if an email, which contains their username and password, is sent to the user.", so it will be invalid with this change

avatar infograf768
infograf768 - comment - 3 Jan 2015

Yep, a bit confused here. The Joomla User plugin param "Notification Mail to User" is explicitely set to be used when a user is created from the back-end, never from the frontend.

Why change this? To prevent automatic registration in frontend, just set "New User Account Activation" to admin.

The change proposed would not be B/C and is useless imho.

avatar PhilETaylor
PhilETaylor - comment - 3 Jan 2015

Yep, a bit confused here. The Joomla User plugin param "Notification Mail to User" is explicitely set to be used when a user is created from the back-end, never from the frontend.

er this is quite obviously not the case, because if you enable that, and then create a user using the frontend registration form, you get an email with your plaintext user/pass in it!

avatar infograf768
infograf768 - comment - 4 Jan 2015

@PhilETaylor
This should depend on the parameters set in the com_users Options.
A mail will always be sent, and this is expected. But its content depends on the options.

screen shot 2015-01-04 at 07 26 21

Setting Send Password to No and New User Account Activation to None, I will get this mail:

screen shot 2015-01-04 at 07 32 07

If I set Send Password to No and New User Account Activation to Self, I will get:
screen shot 2015-01-04 at 07 37 56

etc.

avatar anibalsanchez
anibalsanchez - comment - 15 Jan 2015

@test success

BUT .... there is a minor bug here registration.php, line 510:

if (json_decode(JPluginHelper::getPlugin('user', 'joomla')->params)->mail_to_user)

"User - joomla" plugin is enabled, and mail_to_user is FALSE. Mails are not sent until the plugin saved at least once.

@infograf768 I think this should be fixed in SQL installation scripts ... initializing with same value than displayed in the xml configuraiton.

avatar anibalsanchez anibalsanchez - test_item - 15 Jan 2015 - Tested successfully
avatar infograf768
infograf768 - comment - 16 Jan 2015

Folks, I am closing this one as the basic implementation is correct.
If any bug (in sql or other) please create a new PR.

avatar infograf768 infograf768 - close - 16 Jan 2015
avatar infograf768 infograf768 - change - 16 Jan 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-01-16 08:24:39
avatar anibalsanchez
anibalsanchez - comment - 16 Jan 2015

I have just opened #5765 to follow the activation mails issue.

Add a Comment

Login with GitHub to post a comment