nbcommunication Posted April 13, 2018 Share Posted April 13, 2018 Hi, With the introduction of GDPR regulations, many of our clients with "webuser" systems we've developed need a way to email users that haven't logged-in in a while (18 months seems to be the standard) to ask them if they still want their user account. For most of the systems we've developed, we've added a field to the user template which records the time when the user logs in, so we'll be able to develop this functionality. It got me thinking, would this be a welcome addition to the core, accessed in a similar way to created/modified dates e.g. $user->lastlogin? Were it to be implemented, it would be useful to be able to 'silently login' if using $session->login($username, $pass) or $session->forceLogin($username), in the same way you can bypass save hooks by passing in an option to $pages->save(). Cheers, Chris - NB Communication 8 Link to comment Share on other sites More sharing options...
DV-JF Posted March 5, 2019 Share Posted March 5, 2019 Would be a great addition! Link to comment Share on other sites More sharing options...
sebibu Posted May 22 Share Posted May 22 Indeed!?? Link to comment Share on other sites More sharing options...
bernhard Posted May 22 Share Posted May 22 @sebibu you can easily hook into https://processwire.com/api/ref/session/login-success/ and add the last login timestamp as $page->meta('lastlogin', time()) on the $user object (for example). 3 2 Link to comment Share on other sites More sharing options...
sebibu Posted May 23 Share Posted May 23 Thanks @bernhard! Yesterday I was asking myself if my client has been active in the new system as promised and tried to find and filter a managerlog like in my CMS I used before PW. Now I installed ProcessLoginHistory for the future, but the passed data isn't there. Having that functionality in the core from the installation on would make sense for this case, GDPR and system security in general.. in my opinion. Otherwise or maybe anyway I have to use PW-profiles or similar for my new projects to have the basic extensions and customizations directly at hand. 1 Link to comment Share on other sites More sharing options...
AndZyk Posted May 23 Share Posted May 23 3 hours ago, sebibu said: Having that functionality in the core from the installation on would make sense for this case, GDPR and system security in general.. in my opinion. Hello @sebibu, you can find successful or failed logins under "Setup => Logs => Session" (/processwire/setup/logs/view/session/). You can search those logs for example by username. It should also be possible to search those logs with the API: https://processwire.com/api/ref/wire-log/get-entries/ Hope this helps. ? Regards, Andreas 2 1 Link to comment Share on other sites More sharing options...
sebibu Posted May 24 Share Posted May 24 Oh, that helps a lot! Thanks @AndZyk!!?? 1 Link to comment Share on other sites More sharing options...
cwsoft Posted June 7 Share Posted June 7 (edited) On 5/22/2024 at 4:37 PM, bernhard said: @sebibu you can easily hook into https://processwire.com/api/ref/session/login-success/ and add the last login timestamp as $page->meta('lastlogin', time()) on the $user object (for example). As usual when I have a new idea and wonder how to implement it with PW core only, Bernhard has left a forum post pointing into the direction how to accomplish what I am looking for, even before I posted the question in the forum. I guess I own you a beer or two at least now. Edited June 7 by cwsoft 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now