Plugin: Force Login for Member Pages

I see there are some people looking for some basic privacy on their BP installs. I am working on one to protect all things off the member-theme, this one at least stops member pages from being viewed and if you are not logged in, sends you to the register page.

Copy the following and create a file called force-member-login.php and place in your /mu-plugins/ folder.

I will extend it once I figure out a better way to do this. It would be best extended by adding in the components themselves for people using their own themes, but I did toy with just excluding all access to the theme. That isn’t as good if you use your own theme as you have to edit the plugin. Still working on it though!

Also is there any way to just limit members viewing privileges solely to the groups to which they are subscribed. So for instance if I, as a new member, sign up on a blog I could be automatically relegated to a specific private group. From there I would only be able to see and friend others in my own group?

I haven’t dug around in the code too much to see about this but intend to. Has anybody done this that you know about?

but it sends users to the previously viewed page rather than the link they tried to view.

For example if a user arrives at the homepage and clicks on a link they are sent to /wp-login.php to login, once logged in they are returned to the homepage not the page they wanted to view. This becomes more of a problem for users accessing the site from a link in an email (e.g. a friends invitation) because they are given no page to redirect to after logging in.

But, while testing this, I figured out that the redirect_to doesn’t result in any effect? Even if a valid rediret_to parameter is given, users are always forwarded to the frontpage!? What’s wrong with redirect_to?

Viewing 23 replies - 1 through 23 (of 23 total)

The topic ‘Plugin: Force Login for Member Pages’ is closed to new replies.