WordPress.org

Make WordPress Core

Changeset 14178


Ignore:
Timestamp:
04/21/10 17:58:10 (5 years ago)
Author:
ryan
Message:

Add multisite check on delete. Check promote_user cap. see #13074

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/users.php

    r14176 r14178  
    5656    $update = 'promote'; 
    5757    foreach ( $userids as $id ) { 
    58         if ( ! current_user_can('edit_user', $id) ) 
     58        if ( ! current_user_can('promote_user', $id) ) 
    5959            wp_die(__('You can’t edit that user.')); 
    60         // The new role of the current user must also have edit_users caps 
     60        // The new role of the current user must also have promote_users caps 
    6161        if ( $id == $current_user->ID && !$wp_roles->role_objects[$_REQUEST['new_role']]->has_cap('promote_users') ) { 
    6262            $update = 'err_admin_role'; 
     
    118118 
    119119case 'delete': 
     120    if ( is_multisite() ) 
     121        wp_die( __('User deletion is not allowed from this screen.') ); 
     122 
    120123    check_admin_referer('bulk-users'); 
    121124 
Note: See TracChangeset for help on using the changeset viewer.