Skip to:
Content
Pages
Categories
Search
Top
Bottom

Plugin: bbPress Force Login for Buddypress

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

  • chrishajer
    Participant

    @chrishajer

    Hiya Trent :-)

    Hi Trent, it’s been a long time. Good to see you around this neck of the woods.

    Thanks for sharing the plugin.

    Is Buddypress any good?


    _ck_
    Participant

    @_ck_

    Untested code cleanup (just for fun – untested)

    function force_login_init() {
    if (!bb_is_user_logged_in() && !preg_match("/(bb-login|bb-reset-password|register|xmlrpc).php/s",$_SERVER['REQUEST_URI'])) {
    nocache_headers();
    header("HTTP/1.1 302 Moved Temporarily");
    header("Status: 302 Moved Temporarily");
    bb_safe_redirect( bb_get_uri( 'bb-login.php', null, BB_URI_CONTEXT_HEADER + BB_URI_CONTEXT_BB_USER_FORMS ) );
    exit;
    }
    }

    Good to see you Trent, don’t be a stranger!

    I will be around more again now ;) Been a busy year! Thanks for the cleanup code _ck_ and I will test it tomorrow. Hi back to everyone ;)

    Trent


    Sam Bauers
    Participant

    @sambauers

    $_SERVER['REQUEST_URI'] can be dodgy, _ck_’s code cleanup is probably a little safer.

    Is this the most up to date code? I’ve tried to use it and I am getting no effect. No errors, nothing.

    Is there a specific location where the plugin should reside (besides bb-plugins) or does it need a specific name?

    Also, should the path just be the domain or something else?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar