But: If you only check the user’s ban status on identity validation do note that a logged in user will still be able to do all the user stuff untill his session ends, which if you use a rememberMe implementation can last some time… I never did a ban implementation but I think what I would do would be keep bans in a separate table where id=INT banned=BOOLEAN PK=id this way you should be able to do lightning fast queries that won’t impede your app and you can check on each pageload. On the admin side I probably would (for convenience) couple the banned table as an FK to the users table. That way once you have a user id you can $user->banned=true and on his next pageload the user will be locked out.
I implemented this feature too but since the goal was simply to stop a user from causing damage, I decided to extend ActiveRecord and check for ban in beforeSave.
If they are banned, log them out.
Instead of checking for ban every request, we only check when we really need to (When user change stuff).
Edit: I tried to post a code sample but for some reason it get flagged as spam…