Skip to:
Content

BuddyPress.org

Changeset 4488


Ignore:
Timestamp:
06/12/2011 12:04:50 PM (15 years ago)
Author:
djpaul
Message:

Set is_item_admin/is_item_mod in core component, not members. Fixes #3262

Location:
trunk
Files:
4 edited

Legend:

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

    r4378 r4488  
    161161                $bp->core->table_name_notifications = $bp->table_prefix . 'bp_notifications';
    162162
     163                /**
     164                 * Used to determine if user has admin rights on current content. If the
     165                 * logged in user is viewing their own profile and wants to delete
     166                 * something, is_item_admin is used. This is a generic variable so it
     167                 * can be used by other components. It can also be modified, so when
     168                 * viewing a group 'is_item_admin' would be 'true' if they are a group
     169                 * admin, and 'false' if they are not.
     170                 */
     171                bp_update_is_item_admin( bp_user_has_access(), 'core' );
     172
     173                // Is the logged in user is a mod for the current item?
     174                bp_update_is_item_mod( false,                  'core' );
     175
    163176                do_action( 'bp_core_setup_globals' );
    164177        }
  • trunk/bp-core/bp-core-template.php

    r4466 r4488  
    696696}
    697697
     698function bp_user_has_access() {
     699        $has_access = ( is_super_admin() || bp_is_my_profile() ) ? true : false;
     700
     701        return apply_filters( 'bp_user_has_access', $has_access );
     702}
     703
    698704/** is_() functions to determine the current page *****************************/
    699705
  • trunk/bp-members/bp-members-loader.php

    r4440 r4488  
    8686                // The core userdata of the user who is currently logged in.
    8787                $bp->loggedin_user->userdata       = bp_core_get_core_userdata( $bp->loggedin_user->id );
    88 
    89                 /**
    90                  * Used to determine if user has admin rights on current content. If the
    91                  * logged in user is viewing their own profile and wants to delete
    92                  * something, is_item_admin is used. This is a generic variable so it
    93                  * can be used by other components. It can also be modified, so when
    94                  * viewing a group 'is_item_admin' would be 'true' if they are a group
    95                  * admin, and 'false' if they are not.
    96                  */
    97                 bp_update_is_item_admin( bp_user_has_access(), 'members' );
    98 
    99                 // Is the logged in user is a mod for the current item?
    100                 bp_update_is_item_mod  ( false,                'members' );
    10188
    10289                /** Displayed user ****************************************************/
  • trunk/bp-members/bp-members-template.php

    r4400 r4488  
    755755                return apply_filters( 'bp_get_last_activity', $last_activity );
    756756        }       
    757 
    758 function bp_user_has_access() {
    759         $has_access = ( is_super_admin() || bp_is_my_profile() ) ? true : false;
    760 
    761         return apply_filters( 'bp_user_has_access', $has_access );
    762 }
    763757
    764758function bp_user_firstname() {
Note: See TracChangeset for help on using the changeset viewer.