MyBB Community Forums

Full Version: Redirect if not logged in
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have an external login and registration integrated with mybb.
Not on mybb forum I want to redirect (with headers) user to my external login page. Basically make whole forum private so you cant view it with out account.

Also I want to remove login and registration on forums as well, because i have external login and registration integrated with forums, as i meantioned before.
For the external login page i believe there is a tut in the User Submitted Tutorial section. For the rest its purely permissions and editing the template to remove the login area.
well i am done with external registration/login/logout, I just want compleatly remove register,do_register,login,do_login pages.

Because even after removing from template user can access those manually.
And I am still not sure how to make forum not viewable by guests.
Bump....
To stop guests viewing the forum, just untick the 'Can view board?' option in the Forum and Posts tab in the settings for the Guests group. Then just disable registrations, and they won't be able to register.
Okay, but still when I go to forums I can see the main page without forums list. I want to redirect user right away if he isnt logged in
What code are you using to redirect them...?? If you've denied guests access to view the forum, all they'll see if a No Permissions page, they won't see anything else...
Add in global php an if statement like "if($mybb->user['uid'] == 0) header('Location: urlhere.php')"
(2011-01-25, 10:51 PM)svcghost Wrote: [ -> ]Add in global php an if statement like "if($mybb->user['uid'] == 0) header('Location: urlhere.php')"

Tried, problem: global.php is included in main website because of integration
So it will glitch main website too

http://phpdave.com/MyBBIntegrator/Coding_Help