joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[4.2] Message after a login / logout frontend

Open sandewt opened this issue 5 years ago • 62 comments

Pull Request for Issue # .

New feature, see #30767

Summary of Changes

There is a message after a successfully login and logout in the frontend.

Messages

new_feature_messages_3 new_feature_messages_2 [EDIT] Removed successfully from the text in message.

Users: Options

new_feature_messages_4

Testing Instructions

Backend: Go to Users > Manage > Options (Frontend: Is not applicable.)

Set the options:

  • Frontend Login Message (= Yes, default = No)
  • Frontend Logout Message (= Yes, default = No)

Create a menu link:

  • Menu Login form
  • Menu Logout form
  1. Log in and out, in case of a:
  • Login form (default)
  • Menu Login form
  • Menu Logout form
  1. Code review (developers);
  • Check if the code is correct and secure.

Actual result BEFORE applying this Pull Request

There is NOT showing a message after a suscessfully login or logout.

Expected result AFTER applying this Pull Request

  • There is showing a message after a suscessfully login.
  • There is showing a message after a suscessfully logout.

Documentation Changes Required

Yes.

sandewt avatar Oct 01 '20 07:10 sandewt

Please rebase on 4.1-dev

HLeithner avatar Oct 01 '20 08:10 HLeithner

Please rebase on 4.1-dev

It's just a small extension, a new feature might be a bit exaggerated. Or is there some other argument?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

sandewt avatar Oct 01 '20 11:10 sandewt

I have tested this item :white_check_mark: successfully on 963ad7deca4ef06a722b95009dac832fa42b7a98

I have tested the patch and it works perfectly


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

maikol-ortigueira avatar Oct 01 '20 16:10 maikol-ortigueira

I have tested this item :white_check_mark: successfully on 963ad7deca4ef06a722b95009dac832fa42b7a98

Tested successfully on Joomla 4.0.0-beta5-dev and PHP 7.3.22-1

Thank you!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

pabloarias avatar Oct 01 '20 16:10 pabloarias

i'll not set this PR as RTC despite 2 good tests cause of https://github.com/joomla/joomla-cms/pull/30834#issuecomment-701965397 i'll let the final decision to RL's

alikon avatar Oct 01 '20 17:10 alikon

We might as well all go home if this wont get merged

brianteeman avatar Oct 01 '20 17:10 brianteeman

Some checks were not successful: continuous-integration/drone/pr — Build is failing

What does this mean? Action?

[EDIT] I see that this problem has resolved itself.

sandewt avatar Oct 01 '20 17:10 sandewt

We might as well all go home if this wont get merged

We have 27 release blocker and most of the time I only see some new stuff if no one fixes the release blocker and only add new fancy stuff then you are right and we can go home. https://github.com/joomla/joomla-cms/issues?q=is%3Aopen+is%3Aissue+label%3A"Release+Blocker"

HLeithner avatar Oct 01 '20 17:10 HLeithner

We have 27 release blocker and most of the time I only see some new stuff if no one fixes the release blocker and only add new fancy stuff then you are right and we can go home.

I will close this PR and make a new PR based on [4.1].

sandewt avatar Oct 02 '20 07:10 sandewt

You don't need to, I changed your target branch to 4.1-dev

HLeithner avatar Oct 02 '20 07:10 HLeithner

You don't need to, I changed your target branch to 4.1-dev

I see it has already happened. :smiley:

Thanks.

sandewt avatar Oct 02 '20 08:10 sandewt

Please rebase on 4.1-dev

Please test in Joomla [4.1].

@maikol-ortigueira / @pabloarias


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

sandewt avatar Oct 14 '20 13:10 sandewt

I have tested this item :white_check_mark: successfully on 91ccc4f8401bbb4c22c0c07caae855812d173839


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

tushar33 avatar Oct 17 '20 08:10 tushar33

I have tested this item :white_check_mark: successfully on 91ccc4f8401bbb4c22c0c07caae855812d173839

Nice addition @sandewt. Too many times have I not realised I was logged in or out when wanting to be the reverse after clicking the button in J3.

Testing scenarios all worked.

Please add Documentation Required tag so that it can be noted to go back and review relevant help and JDocs.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

particthistle avatar Nov 01 '20 03:11 particthistle

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

alikon avatar Nov 01 '20 09:11 alikon

I really like the feature (good idea) but I'm not sure about the parameter tbh. Is it needed at all? Perhaps we should (in a future version) go for a message management extension where all this notifications can be managed on one point? Any thoughts?

bembelimen avatar Nov 03 '20 13:11 bembelimen

What kind of message management extension are you looking for? Shouldt a module / plugin / component take care of its own messages?

zero-24 avatar Nov 03 '20 13:11 zero-24

Something like the mail templates?

brianteeman avatar Nov 03 '20 14:11 brianteeman

Yes exactly.

bembelimen avatar Nov 03 '20 15:11 bembelimen

I have tested this item :white_check_mark: successfully on 91ccc4f8401bbb4c22c0c07caae855812d173839

I have tested this item.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

snehaM26 avatar Nov 07 '20 10:11 snehaM26

I have tested this item :white_check_mark: successfully on 91ccc4f8401bbb4c22c0c07caae855812d173839

Its showing a message on login and logout on frontend.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

ashvini77 avatar Nov 07 '20 10:11 ashvini77

Thanks all.

sandewt avatar Nov 13 '20 09:11 sandewt

Again: I would merge it, but I think the parameter are not necessary. We should avoid to add parameter for each thing (yeah I know we did it in the past very often...). If someone want to disable the messages, he/she/it can just make a language override to an empty string.

Additionally I don't think it's necessary to check if user is really logged in, otherwise the login/logout would have returned before, so you can assume, they are.

Could you adjust the PR for this?

bembelimen avatar Nov 15 '20 12:11 bembelimen

Again: I would merge it, I would merge it, but I think the parameter are not necessary.

Sorry, I read about this. Do you mean both parameters? For now I would like to leave it that way, until there is a centrally regulated message system. Or if several want it that way.

Additionally I don't think it's necessary to check if user is really logged in, otherwise the login/logout would have returned before, so you can assume, they are.

You mean?

Change this code:

// Show a message when a user is logged in.
if ($login === 1 && Factory::getUser()->get('id') > 0)

to:

// Show a message when a user is logged in.
if (ComponentHelper::getParams('com_users')->get('frontend_login_message', 0))
{

sandewt avatar Nov 15 '20 13:11 sandewt

Do you mean both parameters?

Yes both parameters.

bembelimen avatar Nov 15 '20 16:11 bembelimen

If someone want to disable the messages, he/she/it can just make a language override to an empty string.

I have the following notes:

  1. Not everyone likes a login / outlog message and can get irritated by it. Hence the default parameters are hide.
  2. Especially novice users of Joomla are often unfamiliar with overrides.

sandewt avatar Nov 18 '20 08:11 sandewt

Additionally I don't think it's necessary to check if user is really logged in, otherwise the login/logout would have returned before, so you can assume, they are.

Done. Deleted check if user is logged in


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

sandewt avatar Nov 30 '20 13:11 sandewt

I have tested this item :white_check_mark: successfully on ce1bf617029d4b3ffd244a0f223d74ec78c1f78e

It's working fine.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

Tejashrimajage avatar Dec 05 '20 12:12 Tejashrimajage

I have tested this item :white_check_mark: successfully on ce1bf617029d4b3ffd244a0f223d74ec78c1f78e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30834.

vaibhavsTekdi avatar Dec 05 '20 12:12 vaibhavsTekdi

@sandewt please remove the parameters they are unneeded and using the override component should be possible with documentation thx

HLeithner avatar Dec 05 '20 13:12 HLeithner