[buddypress-trac] [BuddyPress] #2074: wp-login is not part of $bp->root_components

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Thu Feb 25 21:44:59 UTC 2010


#2074: wp-login is not part of $bp->root_components
----------------------+-----------------------------------------------------
Reporter:  andrew_s1  |       Owner:       
    Type:  defect     |      Status:  new  
Priority:  minor      |   Milestone:  1.2.2
Keywords:  has-patch  |  
----------------------+-----------------------------------------------------

Comment(by andrew_s1):

 Well, here's the code for the plugin, as something has gone horribly wrong
 with my posting to buddypress forums:

 {{{
 <?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');
 ?>
 }}}

-- 
Ticket URL: <http://trac.buddypress.org/ticket/2074#comment:3>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list