Hi, I'm trying to edit my gallery so that it will display the banned user page if the user is part of a certain group.
My plan here is to detect the User's group id and then either let it pass or redirect to a page with the appropriate message.
However, I'm curious if there is a better way to do this. Also, which function should this be placed in (assuming I'm making the change in my theme.php file). Is there a function I can load to display the ban message instead?
Better yet - where is the ban function? It'd be much cleaner to simply add the group to the possible list of conditions.
Much thanks! :)
Hmm, don't mean to bump.
Simplifying my request then - basically where is the file that controls the banning? I would like to add a few extra conditions (ie banning if member is also part of x group).
Bans are configured in banning.php and checked in include/init.inc.php. Searching the code for TABLE_BANNED will tell you all you need to know about banning.
Excellent thank you!
For those curious, this is the code I used (copied from the original init.inc.php):
(insert into the end of init.inc.php - or anywhere really as long as it is read before headers are sent)
if(array_keys($USER_DATA['groups'], ###)||array_keys($USER_DATA['groups'], ###)) {
pageheader($lang_error);
msg_box($lang_info, $lang_errors['banned']);
pagefooter();
exit;
}
### would be the id of the user group. You can also make plenty other conditions. Thankfully the ban code is pretty short and not too much to copy-paste. :)