1

I have a client who's site has a password protected member section. There is also a forum built using the Forum Module.

The client wants the forum to be protected like the rest of the member area as it is only for members. They do not want anyone to be able to see the forum unless they are logged into the member area.

Since there is a login form on the forum itself and you can't see any posts unless you are logged in this seems a little unnecessary but the client has requested this.

Is there a way to do this?

5 Answers 5

3

I actually ended up adding an {if logged_out} to the main forum index template with a redirect to the member login page. Seems to do the trick.

1

you could also wrap the content of the forum template in a {if logged_in} statement

1

If you are using Discussion Forum module then you should wrap the forum content into below condition.

{if logged_in}
    {!-- Your Forum Content --}
{/if}

You can also manage using {if logged_out} condition.

0

If the link to the forum isn't made public, then no one can access it unless they're logged in, correct? Would this not suffice?

<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
{if logged_in}<li><a href="/forum"></a></li>{/if}
</ul>
1
  • 1
    That works unless someone has the direct URL to the forums.
    – mediapimp
    Feb 12, 2013 at 16:03
0

When you folks recommend inserting an "if logged_out" or "if logged_in" check in the forum index template, which template do you mean? The forum templates do not accept EE tags.

I'm also trying to accomplish the same thing — have the forum invisible to logged out members, even if they have the URL — so any guidance would be great. Thanks!

1
  • nvm, figured out a solution: 1. In Forum Board Preferences, turn on "Allow PHP" in PHP parsing preferences, with parsing stage set to output. 2. In themes / forum themes / your_forum_theme / forum_global / html_header.html, add: {if logged_out}<?php header( 'Location: http://yoursite.com/login' );?>{/if}
    – Rob Butz
    Feb 26, 2013 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.