Skip to:
Content

BuddyPress.org

Changeset 6182


Ignore:
Timestamp:
07/16/2012 09:35:25 PM (13 years ago)
Author:
boonebgorges
Message:

Ensures that super admins are always able to delete users from the front end

Even when bp_disable_account_deletion() returns true, it should not prevent
users with the 'delete_users' cap from accessing the delete-account screen or
deleting accounts via bp_settings_action_delete_account().

Fixes #4355

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-functions.php

    r6093 r6182  
    787787
    788788    // Make sure account deletion is not disabled
    789     if ( bp_disable_account_deletion() )
     789    if ( !bp_current_user_can( 'delete_users' ) && bp_disable_account_deletion() )
    790790        return false;
    791791
  • trunk/bp-settings/bp-settings-loader.php

    r6093 r6182  
    130130
    131131        // Add Delete Account nav item
    132         if ( ! bp_disable_account_deletion() ) {
     132        if ( ! bp_disable_account_deletion() || bp_current_user_can( 'delete_users' ) ) {
    133133            $sub_nav[] = array(
    134134                'name'            => __( 'Delete Account', 'buddypress' ),
Note: See TracChangeset for help on using the changeset viewer.