Commit 4e748611 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Reset inactivemailsent flag when users reactivate themselves on login

Users who are about to expire due to inactivity can reactivate
themselves by logging in and thereby updating the lastlogin time.
However, the inactivemailsent flag is never reset, so users who
reactivate themselves in this way could never receive another
inactivity warning email in future.

Change-Id: Iffffd008dc10a6c62987dd38d2e7f18344c8b597
Signed-off-by: default avatarRichard Mansfield <>
parent 625fdf36
......@@ -1319,6 +1319,13 @@ class LiveUser extends User {
// This user may have logged in to reactivate themselves, so now we know they're active, reset
// the fields that may have been changed by cron.
if (!$this->active || $this->inactivemailsent) {
// Properties will be reloaded by the call to $this->commit() below
execute_sql('UPDATE {usr} SET active = 1, inactivemailsent = 0 WHERE id = ?', array($user->id));
// finally, after all is done, call the (maybe non existant) hook on their auth plugin
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment