Skip to:
Content

BuddyPress.org

Ticket #5207: 5207.01.patch

File 5207.01.patch, 894 bytes (added by r-a-y, 11 years ago)
  • bp-members/bp-members-loader.php

    class BP_Members_Component extends BP_Component { 
    134134                                // The canonical URL will not contain the default component
    135135                                unset( $bp->canonical_stack['component'] );
    136136                        }
     137
     138                        // if we're on a spammer's profile page, only users with the 'bp_moderate' cap
     139                        // can view subpages on the spammer's profile
     140                        //
     141                        // users without the cap trying to access a spammer's subnav page will get
     142                        // redirected to the root of the spammer's profile page.  this occurs by
     143                        // by removing the component in the canonical stack.
     144                        if ( bp_is_user_spammer( bp_displayed_user_id() ) && ! bp_current_user_can( 'bp_moderate' ) ) {
     145                                unset( $bp->canonical_stack['component'] );
     146                        }
    137147                }
    138148        }
    139149