Skip to:
Content

BuddyPress.org


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-catchuri.php

    r5234 r5156  
    251251                }
    252252
    253                 // If the displayed user is marked as a spammer, 404 (unless logged-
    254                 // in user is a super admin)
    255                 if ( !empty( $bp->displayed_user->id ) && bp_core_is_user_spammer( $bp->displayed_user->id ) ) {
    256                     if ( is_super_admin() ) {
    257                         bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'error' );
    258                     } else {
    259                         bp_do_404();
    260                         return;
    261                     }
    262                 }
    263 
    264253                // Bump the offset
    265254                if ( isset( $bp_uri[$uri_offset + 2] ) ) {
     
    379368    if ( $bp_no_status_set )
    380369        return false;
     370
     371    // If the displayed user was marked as a spammer and the logged-in user is not a super admin, 404.
     372    if ( isset( $bp->displayed_user->id ) && bp_core_is_user_spammer( $bp->displayed_user->id ) ) {
     373        if ( !$bp->loggedin_user->is_super_admin ) {
     374            bp_do_404();
     375            return;
     376
     377        } else {
     378            bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'error' );
     379        }
     380    }
    381381
    382382    if ( !isset( $wp_query->queried_object ) && !bp_is_blog_page() ) {
Note: See TracChangeset for help on using the changeset viewer.