MyBB Community Forums

Full Version: Banned Users Don't See Header and Can't Log Out
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to figure out a way to prevent banned users from seeing anything in header_welcomeblock_member and remove all logout links for them, so they can't simply log out and create a new user (of course, they can clear their cookies, but not everyone is smart enough to do that). No, I'm not going to just IP ban them. I already tried this using 'PHP in Templates & Conditional Statements', but the result was a mess. Anyone have any ideas how to accomplish this?
Make a new theme and remove the things you dont want and make all banned users use that theme?
That would be great, except there's no group setting to force users of a group to use a specific theme.
In the ACP theme manager -> Edit Theme, there is a setting called "Allowed User Groups" which lets you set which group can use the particular theme. You'll need to export your default theme including the templates and import back back in as a new theme. Give it a name such as "Banned Users". Set "Allowed User Groups" to banned. In your default theme and any other themes you have installed, you'll need to change "Allowed User Groups" from "All User Groups" to every group except banned. I have attached an edited admin\modules\user\banning.php file. When a user is now banned, it will look in the theme table for a theme where allowedgroups=7 and update the user table style field to the banned theme ID. When a ban is lifted, it changes the style field back to 0.This assumes you will have a single banned theme. You will want to edit the Banned theme welcome block by going to Header Templates -> header_welcomeblock_member and remove all links except the logout link.
It should be pointed out before you do all that work that your banned users can just clear their cookies to log out, and that's assuming that they have their options set to remember their login information. Just seems like a lot of work for something that's not actually going to accomplish your goal of preventing logouts (which is impossible). If you've already thought of this and don't care, OK. I just wanted to mention it in case this had not occurred to you Smile
Thanks a lot mtjo!

(2008-08-20, 10:05 PM)Galen Wrote: [ -> ]It should be pointed out before you do all that work that your banned users can just clear their cookies to log out, and that's assuming that they have their options set to remember their login information. Just seems like a lot of work for something that's not actually going to accomplish your goal of preventing logouts (which is impossible). If you've already thought of this and don't care, OK. I just wanted to mention it in case this had not occurred to you Smile

Well I did mention that in my first post Rolleyes
Ah, so you did. I stand corrected.