Forum .LRN Q&A: Banning a user via database

Request notifications

Collapse
Posted by Andy Black on
Hi,

I would like to be able to ban users via the database and also reinstate them if necessary. I can't figure out which table holds the current status of a user.

When I set the Member State to Banned via the front end, their record disappears from the table 'public_registered_users' - but where does it go? They re-appear in that table when I reinstate them.

There must be a table that holds the current state for all users?

Any help would be appreciated
Thanks, Andy

Collapse
Posted by Matthew Coupe on
Hi,

I was wondering if anyone had any ideas on how to do this?

We need to disable 1,000s of user accounts and we're not sure of the best way to do it?

Thanks

Collapse
Posted by Victor Guerra on
Do you need to do it strictly from the database?

What about just writing a tcl script that calls the tcl proc acs_user::ban? it takes simply as parameter the user_id.

Collapse
Posted by Dave Bauer on
You need to update the membership_rels table member_state column to 'banned'.

You'll need to select the rel_id from the acs_rels table based on

object_id_one = acs__magic_object_id('registered_users')

object_id_two = user_id you want to ban

rel_type = 'membership_rel'

Collapse
Posted by Matthew Coupe on
OK, that's great thanks, we'll take a look at these options.

Thanks