Hi, I need to find a way to make the login details of the user expire after they have logged in once using Login. I don't want users to be able to login again for a specific period of time (maybe two or three days or whatever). Can someone advise as to how this can be done? Thanks.
-
☆ A M B ☆
- 24,524 Posts
The last login time is stored in the database, so a plugin could be used to check that time and abort the login if it's before your time period.
Thanks, so what plugin could I use to check that time and abort the login?
-
☆ A M B ☆
- 24,524 Posts
Ah, sorry, it looks like you could use a hook for the Login snippet itself; much easier.
http://rtfm.modx.com/display/ADDON/Login.Using+Pre+and+Post+Hooks
I haven't worked much with Revo yet, so I'm not sure what $hook->getValue('...') you could use. The login pre-hook appears to trigger after the user is validated, but before he's actually registered as being logged in, so you should be able to use $hook->getValue('lastlogin'), which would be in the form of a UNIX timestamp and easy to compare with the PHP function time()
http://www.php.net/manual/en/function.time.php