Skip to:
Content

BuddyPress.org

Ticket #4991: 4999.01.patch

File 4999.01.patch, 1.0 KB (added by r-a-y, 11 years ago)
  • bp-xprofile/bp-xprofile-screens.php

    function xprofile_screen_display_profile() { 
    3737 */
    3838function xprofile_screen_edit_profile() {
    3939
    40         if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) )
     40        // Bail if not the correct screen or if the current user cannot edit this
     41        // user's settings
     42        if ( ! bp_is_my_profile() && ! bp_core_can_edit_settings() ) {
    4143                return false;
     44        }
    4245
    4346        $bp = buddypress();
    4447
    function xprofile_screen_edit_profile() { 
    149152 */
    150153function xprofile_screen_change_avatar() {
    151154
    152         // Bail if not the correct screen
    153         if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) )
     155        // Bail if not the correct screen or if the current user cannot edit this
     156        // user's settings
     157        if ( ! bp_is_my_profile() && ! bp_core_can_edit_settings() ) {
    154158                return false;
     159        }
    155160
    156161        // Bail if there are action variables
    157162        if ( bp_action_variables() ) {