This simple plugin will keep people who are not logged in from viewing any of your forum's content.
As a side effect, feed readers that do not support cookies will not be able to see any of your feeds.
Version: 0.8
Last Updated: 2007-2-12
Requires bbPress Version: 0.8 or higher
Compatible up to: 0.8





This simple plugin will keep people who are not logged in from viewing any of your forum's content.
As a side effect, feed readers that do not support cookies will not be able to see any of your feeds.
I love this plugin b/c it forces people to register to view the forum, instead of allowing them to just troll around for months without even signing up.
If you don't mind people seeing your RSS feed without being registered/logged in, you can add the following line to your code:
&& 0 !== strpos($_SERVER['REQUEST_URI'], bb_get_option( 'path' ) . 'rss.php')
Add it right after the register.php line. This will let people view the feed without being logged in, but theoretically the only way they would know where the feed was is by logging into the forum and clicking on a RSS link. Sure, if they really wanted to they could probably guess, but for most people this will get the job done.
The force-login plugin worked fine for me, until I got a spammer trying to (auto?)register on a forum just created, with a main domain index.html page catching anyone visiting. I wonder how he knew the index.php was there..?
Anyway, I enabled Akismet and the SkipAkismet (for moderators) plugin, but then found I couldn't register as a new test member. Clicking 'Register' just kept sending me back to the Log-in page, meaning nobody could register. I've disabled force-login, but for one forum I definitely need to stop non-authorised visitors reading posts. Off to trawl the plugins again.
This plugin is very old and I'm not crazy about the way this plugin works, it tries to directly load the login template at bb_init which is bad behavior as it steps on other plugins, it even skips bb_send_headers which happens after init.
A redirect might be better and definitely change the last line to this:
add_action( 'bb_init', 'force_login_init',999);
Which allows other plugins to initialize before it.
It also might more reliable to use PHP_SELF to compare the script name instead of the URL
So is it safe to use this plugin with 0.9 (and I guess 1.0 soon) until something more reliable comes along?
You must log in to post.