Feature No Code Attached Yet
avatar samuelagus
samuelagus
4 Sep 2025

Is your feature request related to a problem? Please describe.

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.

Describe the solution you'd like

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.

Additional context

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!

avatar samuelagus samuelagus - open - 4 Sep 2025
avatar joomla-cms-bot joomla-cms-bot - change - 4 Sep 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Sep 2025
avatar samuelagus samuelagus - change - 4 Sep 2025
The description was changed
avatar samuelagus samuelagus - edited - 4 Sep 2025
avatar samuelagus samuelagus - change - 4 Sep 2025
The description was changed
avatar samuelagus samuelagus - edited - 4 Sep 2025
avatar alikon alikon - change - 4 Sep 2025
Labels Added: Feature
avatar alikon alikon - labeled - 4 Sep 2025
avatar alikon
alikon - comment - 6 Sep 2025

@samuelagus would you like to do a pull request for adding

descending Order

as a first step ?

i'm not a big fan for adding more setting options, but your proposal

It would be more interesting if there is an option to sort by name/username or by datetime in ascending or descending order.

make sense too

avatar brianteeman
brianteeman - comment - 6 Sep 2025

Dont forget that this is showing the users who are currently logged in. Not the last x users who have logged in

avatar alikon
alikon - comment - 6 Sep 2025

yes but having an order imho is more useful

avatar samuelagus
samuelagus - comment - 8 Sep 2025

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 :)

avatar alikon alikon - change - 8 Sep 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-09-08 12:52:48
Closed_By alikon
avatar alikon alikon - close - 8 Sep 2025
avatar alikon
alikon - comment - 8 Sep 2025

closing as we have a pull request #46047

avatar brianteeman
brianteeman - comment - 8 Sep 2025

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

Add a Comment

Login with GitHub to post a comment