Improve proposal: new feature.
There is showing a message after a logout. (Optional)
There is NOT showing a message after logout.
Is not applicable.
Earlier I wanted to introduce this in Joomla 3.x.
Apparently there was no need for that.
See #19477.
I want to re-evaluate this new feature for J4. @Quy.
Labels |
Added:
?
|
The login message may be useful. I would also set a login message.
The login message may be useful. I would also set a login message.
But then as an option in the settings..
To consider:
When logging out from a page which access was restricted to the group the user was set to, we get an error page as a 404.
enqueue message should still work
For a simpler and better control structure, the User - Joomla! plugin
seems now to be a better option.
Moreover, it is now possible to generate a login and/or a logout message
for the backend and frontend
.
file: \Joomla\plugins\user\joomla\joomla.php
public function onUserLogin($user, $options = [])
{
....
// Show a message when the user is actually logged in.
if ((int) $this->params->get('message_login', 0) && Factory::getUser()->get('id') > 0)
{
$this->app->enqueueMessage(Text::_('PLG_USER_JOOMLA_MESSAGE_LOGIN'), 'message');
}
return true;
}
public function onUserLogout($user, $options = [])
{
...
// Show a message when the user is actually logged out.
if ((int) $this->params->get('message_logout', 0) && Factory::getUser()->get('id') === 0)
{
$this->app->enqueueMessage(Text::_('PLG_USER_JOOMLA_MESSAGE_LOGOUT'), 'message');
}
return true;
}
Actually I think you don't need an option for logout and the location should be in the com_users controller logout function no need to do this in the joomla user plugin.
I see no useful information in a login message but ok.
Actually I think you don't need an option for logout and the location should be in the com_users controller logout function no need to do this in the joomla user plugin.
Sounds logical, but I know more about plugins. Hence.
The changes I suggest here with built-in controls are very easy to implement.
I know that shouldn't be an argument.
I see no useful information in a login message but ok.
The login message may be useful. I would also set a login message.
[EDIT] Much of such logic is handled in the plugins!
Question: Where are the return true
statements handled in the (com_users) controller?
file: \Joomla\plugins\user\joomla\joomla.php
public function onUserLogin($user, $options = [])
{
....
return true;
}
public function onUserLogout($user, $options = [])
{
....
return true;
}
Question: Where are the return true statements handled in the (com_users) controller?
In the meantime I found out that this functionality can easily be put in \components\com_users\src\Controller\UserController.php for the frontend.
Backend? Necessary?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-10-01 09:21:47 |
Closed_By | ⇒ | alikon |
The easiest way is to add a small piece of code to the system plugin logout.
But I don't know if that's allowed !?
In any case, it seems to work fine.
\plugins\system\logout\logout.php