1

I frequently want to check if a particular set of users are currently logged into the back end (administrator side) of my site (e.g. so I don't do anything disruptive while they are logged in) and, less importantly, how long they were logged into my site during each session when they were logged in (e.g. so I know how much time my employees are spending logged into my site).

Using Users->User Actions Log I can see when everyone logged in but I can't see when they logged out, either manually or due to an inactivity timer expiration. Is there a way to add the user logout time to the User Actions Log or some other software that tracks users login/logout times? I'm on Joomla 3.9.28.

What I really want to know about is users logging in/out of the back end (admin side) of the site, I really don't care about users logging into the front end and so hadn't initially considered that the current Actions Log includes both front and back end logins. I realized that when I found this plugin*:

https://help.joomlatools.com/article/313-configuring-logman#user-login-logout

which says it's not suitable for sites with large numbers of users, which mine has for the front end but not for the back end that I actually care about. Having said that, I might be OK with software that tracks both front and back end login/logout, I'd have to test it to see if it's too much.

*I can't use that plugin because as it says:

LOGman will track a users logout when the user explicitly logs out by clicking the logout button. LOGman cannot track the logout if the users session expires."

so it only does part of the necessary job.

I found a similar question to this at https://forum.joomla.org/viewtopic.php?t=844869 which took me to another plugin, https://www.joomlathat.com/content-statistics, but it also doesn't display when a user is logged out due to inactivity, just when they click the "logout" button.

If there isn't a way to see a log of when someone logged out, is there at least a way to tell who is currently logged in?

7
  • 1
    Looking at the user Action Log itself I would say there are two events already triggered onUserAfterLoginline 777 and onUserLogoutline 864 that checks if it is checkLoggable and then logs those actions but no time is set, as you noted. How able are you to write PHP code? You can easily solve this with your own Plugin, since there are events you can just trigger on those same events and log the time.
    – Llewellyn
    Jul 13 at 6:11
  • 1
    But it does seem to set a time stamp on line 68 when the message is logged...
    – Llewellyn
    Jul 13 at 6:15
  • 1
    With inactivity a person isn't actually logged out as no action or event has occurred to be recorded and hence you only see a message to say they logged back in again, but no logout message is recorded. You would need to do some sort of periodic checking of active sessions to see if or when a particular user(s) no longer has a valid session. The module in the Admin page control page showing currently logged in users might be a good place to start as it is checking for who is still active.
    – Irata
    Jul 13 at 8:16
  • @Llewellyn thanks, but I'm not going to write PHP for this or create my own Plugin for this, as I haven't written more than a couple of lines of PHP in the past and more importantly it's something I'd use if it exists but I don't want to deal with writing (and then having to remember in future!) my own code.
    – Ed Morton
    Jul 13 at 12:53
  • @Irata thanks, but when I log into my Joomla site and walk away for an hour then come back I'm no longer logged in. So apparently some inactivity timer expired and the system logged me out - I have expected that to be considered as an event and logged somewhere. Ditto for if I actually click the "Logout" button - surely that's also an event that gets logged somewhere.
    – Ed Morton
    Jul 13 at 13:02
2

To answer your newer question,

If there isn't a way to see a log of when someone logged out, is there at least a way to tell who is currently logged in?

You can only record when someone takes an action to log out, i.e. presses the logout button, you cannot record someone whose session has expired and therefore required to go through the login process again.

See my comments to your original post for more background but your question is really 'Who has or had an active admin session?'

If you don't want to write any code then, as you mention, then you have this module in the admin pages that shows you currently 'logged in' which would be more accurate if it said 'Active Sessions' but it is real time, there is no logging or recording. enter image description here

Note: If you use Shared Sessions then there is no distinction shown for Administration sessions.

If you don't see the 'Logged-in Users' module on your Control Panel, which I believe is displayed by default, then you can go to Extensions->Modules and filter the list by Administrator, not Site, and it should be listed there with a position of 'cpanel'. enter image description here

To log or record when certain people are logged into your back end I expect you would need a cron job running periodically in the background recording who has an admin session at that particular moment.

2
  • It's extremely disappointing to hear that there's no reliable record of when anyone [became] logged out (it's really unthinkable to me to build such a system - where's the QWAN/symmetry?) but I do see that "Logged In Users" list under System->Control Panel when I scroll down so that helps with my main problem of not wanting to do anything invasive while specific people are logged in. Thanks and sorry for needing my hand held to find it!
    – Ed Morton
    Jul 14 at 12:13
  • 1
    @EdMorton If you change the order of the admin modules and drag the Logged In users towards the top it will be more obvious to see when you login. I wasn't going to ask if you had scrolled down, but on one of my environments I did notice it was below the fold. :)
    – Irata
    Jul 15 at 2:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.