Is it possible to see all current logged in users and inform them about emergency maintenance?

I can use variables like <%=user%> or <%=instance.createdByEmail%> to help a single, logged in user with his activities. I also can find out about last logins or inactive users from those variables, so I can address a user group after their actual login.

Is there any way to see all currently, still logged in users? I need to find out how many there are, who it is, and then I would like to use this information for further action like calling out emergency maintenance soon. I also know about Message Of The Day, but this would not get out to named persons and I cannot force response from them…

Hi, and welcome to the forum. I noticed this has gone unanswered, so I thought I’d have a go at it and feedback with my thoughts.

There’s nothing built-in. You’ve found “message of the day”, and that was my first thought also.

There’s nothing in the API. It’s close, we can see logins, and failed logins, but not an “isLoggedIn” property.

That applies to listusers and getuser endpoints I checked the documentation here:

and here:

So, we have the database left. There’s no session type table, but we do have an “audit_log” table

And it’s all in there. In the screen grab below, we can see the login event of my user and my logout event (which is the same whether I time out, or actually log out I think).

You should consider adding this to the ideas section. I wonder how hard it would be to add a flag in the API given the database is tracking user state for audit purposes.

For now it is possible, but it will require you query the database and track the status of each user. It would make a nice project!

Hope that is helpful to some extent.

Hi, thank you for giving your knowledge and ideas. This helps and confirms my results so far. I will raise a new post in the ideas area of the forum as suggested. See, if others support the idea then :slight_smile:

1 Like

My pleasure. Incidentally this is an excellent use case for a custom report plugin.

This is the SQL that returns the logged in users, their last login time, and their session time in minutes.

For you or anybody else in the community that wishes to take this approach.