User Login/Logoff

Hello Forum,

during a NextCloud update I missed that another customer wanted to work with NextCloud and was surprised that NextCloud is not available for about 30 minutes.

I am surprised that the user login to NextCloud is not logged with a timestamp …

I found the table oc_users in the NextCloud database and wondered if I could write a simple ‘date ‘+%A %W %Y %X’’ in a new column.

My understanding problem is that I don’t know where to put my <?php code; which “event handler” is responsible for login/logout.
Especially this one should survive an update.

I’ve already browsed a lot of Nextcloud documentation but can’t find a common thread. Can you give me a hint?

Thanks a lot and best regards

At first using the search function of the forum helps a lot to find the desired information :wink: As usual multiple ways exist to solve a problem:

  1. The last login time can be seen if you open the users dialog in the upper right corner, open “Settings” in the lower left corner, tick the “Show last login” option and scroll the list of displayed users to the right.

  2. You can use the occ command to display the last login time of a user.

    Get users last login date

  3. You can install/activate the “Auditing / Logging” app to get sensitive information logged to the Nextcloud log file.

exactly what I was looking for. Thank you very much

I have now tried all your hints. The following questions arise:
You can log out of the Nextcloud and you will not be shown in Auditing/Logging anymore, but there are still some entries that I can’t quite understand. Isn’t there a global “logout” without restarting Nextcloud?
The delivered value “last_seen” is nice but not very meaningful. Thanks for the support