Make WordPress Core

Changeset 13431


Ignore:
Timestamp:
02/26/2010 05:16:31 PM (15 years ago)
Author:
wpmuguru
Message:

prevent admins from removing themselves and main super admin from super admin list, See #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-edit.php

    r13423 r13431  
    497497        } elseif ( isset( $_POST[ 'remove_superadmin' ] ) ) {
    498498            $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
     499            $admin_email = get_site_option( 'admin_email' );
    499500            foreach ( (array) $_POST['allusers'] as $key => $val ) {
    500501                if ( $val == '' || $val == '0' )
    501502                    continue;
    502503                $user = new WP_User( $val );
     504                if ( $user->ID == $current_user->ID || $user->user_email == $admin_email )
     505                    continue;
    503506                foreach ( $super_admins as $key => $username ) {
    504507                    if ( $username == $user->user_login ) {
Note: See TracChangeset for help on using the changeset viewer.