WordPress.org

Make WordPress Core

Ticket #14051: 14051.diff

File 14051.diff, 2.5 KB (added by duck_, 4 years ago)
  • wp-admin/user-edit.php

     
    141141        if ( $delete_role ) // stops users being added to current blog when they are edited 
    142142                delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); 
    143143 
    144         if ( is_multisite() && is_network_admin() & !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) 
     144        if ( is_multisite() && is_network_admin() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) 
    145145                empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 
    146146} 
    147147 
     
    229229                <td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr($profileuser->user_login); ?>" disabled="disabled" class="regular-text" /> <span class="description"><?php _e('Usernames cannot be changed.'); ?></span></td> 
    230230        </tr> 
    231231 
    232 <?php if ( !IS_PROFILE_PAGE && !is_network_admin() ): ?> 
     232<?php if ( !IS_PROFILE_PAGE && !is_network_admin() ) : ?> 
    233233<tr><th><label for="role"><?php _e('Role:') ?></label></th> 
    234234<td><select name="role" id="role"> 
    235235<?php 
     
    249249?> 
    250250</select> 
    251251<?php endif; //!IS_PROFILE_PAGE 
    252 if ( is_multisite() && is_network_admin() && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?> 
     252 
     253if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?> 
    253254<tr><th><label for="role"><?php _e('Super Admin'); ?></label></th> 
    254255<td> 
    255 <p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.'); ?></label></p> 
     256<?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) ) : ?> 
     257<p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p> 
     258<?php else : ?> 
     259<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p> 
     260<?php endif; ?> 
     261</td></tr> 
    256262<?php } ?> 
    257 </td></tr> 
    258263 
    259264<tr> 
    260265        <th><label for="first_name"><?php _e('First Name') ?></label></th>