Skip to:
Content
Pages
Categories
Search
Top
Bottom

[was: All site data visible to members and non-members alike]


  • andrew_s1
    Participant

    @andrew_s1

    Following on from this thread, which went a bit odd and wasn’t allowing replies or showing the most recent posts:

    I’ve submitted a ticket for the issue of wp-login not being registered as a root_component:

    http://trac.buddypress.org/ticket/2074

    There’s a patch attached to that ticket, to make the necessary changes to bp-core.php

    And here’s my revision of the lockout plugin:

    <?php

    /*

    Plugin Name: BuddyPress Lockdown

    Plugin URI: http://buddypress.org/

    Description: Lock down your BuddyPress site if a user is not logged in.

    Author: Andy Peatling & Andrew_S1

    Version: 1.2

    Author URI: http://buddypress.org/

    Site Wide Only: true

    */

    function bp_lockdown() {

    global $bp;

    if ( BP_REGISTER_SLUG != $bp->current_component &&

    BP_LOGIN_SLUG != $bp->current_component &&

    BP_LOGIN1_SLUG != $bp->current_component &&

    !is_user_logged_in() ) {

    bp_core_redirect( site_url( BP_LOGIN_SLUG ) );

    }

    }

    function wp_lockdown() {

    if ( !is_user_logged_in() ) {

    auth_redirect( 'wp-login.php' );

    }

    }

    add_action( 'bp_init', 'bp_lockdown');

    // if no buddypress, have a backup plan

    add_action( 'send_headers', 'wp_lockdown');

    ?>

  • The topic ‘[was: All site data visible to members and non-members alike]’ is closed to new replies.
Skip to toolbar