Module Logged-in Users is not sorted well.
We have to look at the date and time in each row to find out who logged in most recently.
It will be more difficult if there are many users logged in.
I suggest to add an "descending Order" at the getList function (line 50) in this file administrator/modules/mod_logged/src/Helper/LoggedHelper.php
So it will be like this:
$query = $db->getQuery(true)
->select('s.time, s.client_id, u.id, u.name, u.username')
->from('#__session AS s')
->join('RIGHT', '#__users AS u ON s.userid = u.id')
->where('s.guest = 0')
->order('s.time DESC')
->setLimit($params->get('count', 5), 0);
By adding ->order('s.time DESC') in the query, the list in the module will be sorted by datetime in descending order, so Admin can find out more quickly which users have logged in recently in sequence.
It would be more interesting if there is an option to sort by name/username or by datetime in ascending or descending order.
J5.3.2!
| Labels |
Added:
No Code Attached Yet
|
||
| Labels |
Added:
Feature
|
||
Dont forget that this is showing the users who are currently logged in. Not the last x users who have logged in
yes but having an order imho is more useful
Dont forget that this is showing the users who are currently logged in. Not the last x users who have logged in
Please try this...
Open the Module Logged-in Users
Change Users to Display to 10
Go to Advanced Tab, change the Automatic Title to YES, the module title will be change automatically to: Last 10 Logged-in Users
So, Yes this module shows "last x users who have logged in" as you said :)
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-09-08 12:52:48 |
| Closed_By | ⇒ | alikon |
So, Yes this module shows "last x users who have logged in" as you said :)
No. It shows the last x users who are currently logged in
@samuelagus would you like to do a pull request for adding
as a first step ?
i'm not a big fan for adding more setting options, but your proposal
make sense too