Banned - user state, group membership, only one, both?

Steve Freides

Active member
Licensed customer
I would appreciate insights into the difference between managing via group membership and user state.

We put users in groups with varying rights access. When I ban someone, it seems simpler to me - because it would be more like other things I manage via the ACP - to have them added to the group Banned rather than having their userstate changed.

We have a developer who manipulates our XF database directly. I'm am a XF super-moderator of our forum, effectively the admin as far as our users are concerned, and the above-mentioned developer is the actual admin.

Two specific questions:
1. What's involved in making the banning process also add membership in the group Banned and where, if anywhere, in the ACP would I find this?
2. Where in the DB - table, field - does the flag for a banned user live? (I'm an ex-developer decades ago, but if it's too complicated to explain here, OK.)

Thanks in advance for your replies.

-S-
 
Last edited:
xf_user has an is_banned boolean col. This will be populated if you actually ban the member the XF way. if you play with groups, it might not be.

Suggest you use xf native banning mechanism and stop re-inventing what already exists. There's really no point in adding a banned user to any groups as groups come after the ban check everywhere i looked.


Code:
select * from xf_user where is_banned = 1;


There's code everywhere that looks for this, not groups.

Code:
public function assertNotBanned()
    {
        if (\XF::visitor()->is_banned)
        {
            throw $this->exception(
                $this->plugin(ErrorPlugin::class)->actionBanned()
            );
        }
    }
 
Back
Top Bottom