WordPress.org

Make WordPress Core

Changeset 19646


Ignore:
Timestamp:
01/02/12 21:45:38 (2 years ago)
Author:
ryan
Message:

Only allow _multisite_ super admins to demote themselves on a site. props linuxologos, fixes #19684 for 3.3

Location:
branches/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3

  • branches/3.3/wp-admin/users.php

    r19528 r19646  
    101101        if ( ! current_user_can('promote_user', $id) ) 
    102102            wp_die(__('You can’t edit that user.')); 
    103         // The new role of the current user must also have the promote_users cap or be a super admin 
    104         if ( $id == $current_user->ID && ! is_super_admin() && ! $wp_roles->role_objects[ $_REQUEST['new_role'] ]->has_cap('promote_users') ) { 
    105             $update = 'err_admin_role'; 
    106             continue; 
     103        // The new role of the current user must also have the promote_users cap or be a multisite super admin 
     104        if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $_REQUEST['new_role'] ]->has_cap('promote_users') 
     105            && ! ( is_multisite() && is_super_admin() ) ) { 
     106                $update = 'err_admin_role'; 
     107                continue; 
    107108        } 
    108109 
  • branches/3.3/wp-includes/capabilities.php

Note: See TracChangeset for help on using the changeset viewer.