Don't show super admin checkbox for the user that has the network admin email address. Props duck_. fixes #14051

git-svn-id: https://develop.svn.wordpress.org/trunk@16767 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-12-07 18:10:16 +00:00
parent 5eb199f6f3
commit 712aeeae45
1 changed files with 10 additions and 5 deletions

View File

@ -141,7 +141,7 @@ if ( !is_multisite() ) {
if ( $delete_role ) // stops users being added to current blog when they are edited
delete_user_meta( $user_id, $blog_prefix . 'capabilities' );
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 ) )
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 ) )
empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
}
@ -249,12 +249,17 @@ else
?>
</select>
<?php endif; //!IS_PROFILE_PAGE
if ( is_multisite() && is_network_admin() && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
<tr><th><label for="role"><?php _e('Super Admin'); ?></label></th>
<td>
<?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) ) : ?>
<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>
<?php } ?>
<?php else : ?>
<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p>
<?php endif; ?>
</td></tr>
<?php } ?>
<tr>
<th><label for="first_name"><?php _e('First Name') ?></label></th>