This is probably a common request/hack so that is why I am describing what I have done.
I took Billspaintball's script for use as a single point login for my site, with the
objective of not letting anyone into my entire site without the correct credentials/authorization. I want to
permit access only to user groups 2,5,6,or 7 (registered users, moderators, and admins).
www.mysite.com
www.mysite.com/forums
A page with Bill's script code sits at the root (index.php) and my forum is under /forums. If a non-authorized user comes along I want to bounce him/her back to the ROOT with a message.
First I set the permissions of the usergroups to what I think they should be to stop them from getting nto my site at all, then I also use the following alteration of Bill's code on the root index page:
Code:
if($isAdmin){
//show welcome message
//show logout link
//show link to forum
}elseif($isAuthorized){
//javascript that sends authorized user to the forum homepage /forums
echo "
<script>
document.onload = redir();
function redir(){
window.location.replace(\"forums\");
}
</script>
";
}else{
//USER IS NOT AUTHORIZED
//show a specific message regarding why they do not have access
//show login boxes
//show registration request link ONLY if user is usergroup 1 (Unregistered / Not Logged In)
}
The complication arises when I set the permissions of the usergroups of the unauthorized users. I dont want them to see ANYTHING. However, if I set the permissions of these users so that
Usergroup Manager>>Forum Viewing Permissions>>Can View Forum == NO, the basic VBulletin authentication stops working correctly and I get a ghostlike home index page that appears like a screwed up version of the forum index page (see 1st attached snapshot). Also, logout stops working (see second attached snapshot).
If I change the permissions and allow my defined set of unauthorized usergroups access to view forums the problem goes away. However, this defeats my goal in preventing these unauthorized users from seeing the forum in the first place and by typing in /forum they can view the forum homepage!
Can anyone can shed light on this and help me achieve what I would like to do?
Thanks!
Jonathan