Skip to:
Content

BuddyPress.org

Changeset 13795


Ignore:
Timestamp:
04/13/2024 08:20:06 AM (6 months ago)
Author:
imath
Message:

Make sure only Community Admins can assign member types

Props vapvarun

Fixes #9097
Closes https://github.com/buddypress/buddypress/pull/270

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-members-admin.php

    r13574 r13795  
    14921492        $current_type = (array) bp_get_member_type( $user->ID, false );
    14931493        $types_count  = count( array_filter( $current_type ) );
     1494        $disabled     = ! bp_current_user_can( 'edit_users' ) && ! bp_current_user_can( 'bp_moderate' );
    14941495        ?>
    14951496
     
    15041505                <li>
    15051506                    <label class="selectit">
    1506                         <input value="<?php echo esc_attr( $type->name ) ?>" name="bp-members-profile-member-type[]" type="checkbox" <?php checked( true, in_array( $type->name, $current_type ) ); ?>>
     1507                        <input value="<?php echo esc_attr( $type->name ) ?>" name="bp-members-profile-member-type[]" type="checkbox" <?php checked( true, in_array( $type->name, $current_type ) ); ?> <?php disabled( $disabled ); ?>>
    15071508                        <?php echo esc_html( $type->labels['singular_name'] ); ?>
    15081509                    </label>
     
    15311532
    15321533        // Permission check.
    1533         if ( ! bp_current_user_can( 'edit_users' ) && ! bp_current_user_can( 'bp_moderate' ) && $user_id != bp_loggedin_user_id() ) {
     1534        if ( ! bp_current_user_can( 'edit_users' ) && ! bp_current_user_can( 'bp_moderate' ) ) {
    15341535            return;
    15351536        }
Note: See TracChangeset for help on using the changeset viewer.