Skip to:
Content

BuddyPress.org

Changeset 6519


Ignore:
Timestamp:
11/14/2012 08:29:28 PM (14 years ago)
Author:
djpaul
Message:

Only register subnav items if user has appropriate authorisation. See #4661

Location:
trunk
Files:
3 edited

Legend:

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

    r6342 r6519  
    101101        function setup_nav() {
    102102
     103                if ( ! bp_is_my_profile() )
     104                        return;
     105
    103106                $sub_nav = array();
    104107                $name    = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
  • trunk/bp-settings/bp-settings-loader.php

    r6317 r6519  
    125125
    126126                // Add Delete Account nav item
    127                 if ( ! bp_disable_account_deletion() || bp_current_user_can( 'delete_users' ) ) {
     127                if ( is_user_logged_in() && ! bp_disable_account_deletion() || bp_current_user_can( 'delete_users' ) ) {
    128128                        $sub_nav[] = array(
    129129                                'name'            => __( 'Delete Account', 'buddypress' ),
  • trunk/bp-xprofile/bp-xprofile-loader.php

    r6352 r6519  
    172172                );
    173173
    174                 // Edit Profile
    175                 $sub_nav[] = array(
    176                         'name'            => __( 'Edit', 'buddypress' ),
    177                         'slug'            => 'edit',
    178                         'parent_url'      => $profile_link,
    179                         'parent_slug'     => $this->slug,
    180                         'screen_function' => 'xprofile_screen_edit_profile',
    181                         'position'        => 20
    182                 );
    183 
    184                 // Change Avatar
    185                 $sub_nav[] = array(
    186                         'name'            => __( 'Change Avatar', 'buddypress' ),
    187                         'slug'            => 'change-avatar',
    188                         'parent_url'      => $profile_link,
    189                         'parent_slug'     => $this->slug,
    190                         'screen_function' => 'xprofile_screen_change_avatar',
    191                         'position'        => 30
    192                 );
     174                if ( bp_is_my_profile() ) {
     175                        // Edit Profile
     176                        $sub_nav[] = array(
     177                                'name'            => __( 'Edit', 'buddypress' ),
     178                                'slug'            => 'edit',
     179                                'parent_url'      => $profile_link,
     180                                'parent_slug'     => $this->slug,
     181                                'screen_function' => 'xprofile_screen_edit_profile',
     182                                'position'        => 20
     183                        );
     184
     185                        // Change Avatar
     186                        $sub_nav[] = array(
     187                                'name'            => __( 'Change Avatar', 'buddypress' ),
     188                                'slug'            => 'change-avatar',
     189                                'parent_url'      => $profile_link,
     190                                'parent_slug'     => $this->slug,
     191                                'screen_function' => 'xprofile_screen_change_avatar',
     192                                'position'        => 30
     193                        );
     194                }
    193195
    194196                parent::setup_nav( $main_nav, $sub_nav );
Note: See TracChangeset for help on using the changeset viewer.