I would like to keep the entire forum private. Hence I removed the permissions of guest to the forums and all other features as suggested by other people. However when the user visits the forums, he is shown the home page but not the login page.
Can anyone suggest me the right way to do this without hacking the index.php or other core elements of phpbb3?
Know I'm coming in late but I hard-coded a redirect:
if ($user->data['user_id'] == ANONYMOUS)
{
header('Location: [your phpbb location]/ucp.php?mode=login');
exit;
}
right after these lines
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
in the index.php file found in the root of your phpbb project.
This will redirect unauthorized users directly to the login page as soon as they hit the index.php page.
NOTE: Anytime an unauthorized user hits the index file they will be redirected to the login page (e.g. after logging out)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With