Forums | Mahara Community
Developers
/
Suspend users
03 May 2010, 22:44
Hi,
We had about 200 duplicated user logins in the system and was looking at the option of suspending them. We decided to suspend the users via a SQL command rather than updating 200 times in the user interface. The SQL command that I used was as follows:
set suspendedctime = '2010-04-12 15:32:57', suspendedreason = 'This duplicate user account has been suspended to avoid confusion. Please use your account name without an underscore at the end.', suspendedcusr = 1
where username like '%/_' ESCAPE '/'
04 May 2010, 0:09
From my recollection, just setting the suspendedctime is all that's necessary. Also, a cron job runs that keeps the active flag in sync, so you can update it but you don't have to. You may as well, I guess
09 May 2010, 17:42
Thanks Nigel. I've done the SQL in the database to inactivate the suspended users. Meanwhile, just wondering why the cron job isn't doing the job properly. Can you advise which cron job it is and how to check whether it's working properly?
09 May 2010, 19:11
Aha, I was not correct. It's not a cron job that updates it. Instead, the Auth plugin type subscribes to a bunch of internal Mahara events in order to update the flag. Because you were updating the flag in the database directly, the Mahara events weren't being triggered. See the PluginAuth class in auth/lib.php (at the bottom) for more details.