Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/14/2011 05:19:12 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Find/replace on is_super_admin() to use bp_current_user_can( 'bp_moderate' ). See #3740.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-classes.php

    r5302 r5329  
    7878        global $bp, $wpdb;
    7979
    80         if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != bp_loggedin_user_id() ) ) )
     80        if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
    8181            $hidden_sql = "AND wb.public = 1";
    8282        else
     
    195195
    196196        // If the user is logged in return the blog count including their hidden blogs.
    197         if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || is_super_admin() )
     197        if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || bp_current_user_can( 'bp_moderate' ) )
    198198            return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
    199199        else
     
    206206        $filter = like_escape( $wpdb->escape( $filter ) );
    207207
    208         if ( !is_super_admin() )
     208        if ( !bp_current_user_can( 'bp_moderate' ) )
    209209            $hidden_sql = "AND wb.public = 1";
    210210
     
    221221        global $bp, $wpdb;
    222222
    223         $hidden_sql = !is_super_admin() ? "AND wb.public = 1" : '';
     223        $hidden_sql = !bp_current_user_can( 'bp_moderate' ) ? "AND wb.public = 1" : '';
    224224        $pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
    225225
     
    235235        $letter = like_escape( $wpdb->escape( $letter ) );
    236236
    237         if ( !is_super_admin() )
     237        if ( !bp_current_user_can( 'bp_moderate' ) )
    238238            $hidden_sql = "AND wb.public = 1";
    239239
Note: See TracChangeset for help on using the changeset viewer.