2012-12-27, 06:24 PM
So, I want to have a private mybb, that requires a login on all except 2 pages. (Both URL's I want guest access end in .php, incase it matters)
I have this:
Right, this seems to do the trick. Open up global.php and find the line:
PHP Code:
$plugins->run_hooks("global_end");
After the above line, add this:
PHP Code:
if ($mybb->user['uid'] == 0 AND $current_page != 'member.php' AND ($mybb->input['action'] != 'login' OR $mybb->input['action'] != 'do_login')) {
redirect('member.php?action=login', "Please login to access this site.", "Please Login");
}
Now if the user is not logged in and goes to any pages except the login pages, they will be redirected to login.
What do I need to edit to allow the index.php, and media.php to be accessible to guests?
Thanks!
I have this:
Right, this seems to do the trick. Open up global.php and find the line:
PHP Code:
$plugins->run_hooks("global_end");
After the above line, add this:
PHP Code:
if ($mybb->user['uid'] == 0 AND $current_page != 'member.php' AND ($mybb->input['action'] != 'login' OR $mybb->input['action'] != 'do_login')) {
redirect('member.php?action=login', "Please login to access this site.", "Please Login");
}
Now if the user is not logged in and goes to any pages except the login pages, they will be redirected to login.
What do I need to edit to allow the index.php, and media.php to be accessible to guests?
Thanks!