Permalink
Browse files

Don't show super admin checkbox for the user that has the network adm…

…in email address. Props duck_. fixes #14051

git-svn-id: http://svn.automattic.com/wordpress/trunk@16767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 2eba21d commit d5f81d06f946c8112838f8d50d16d5ef5aa9fa0c ryan committed Dec 7, 2010
Showing with 10 additions and 5 deletions.
  1. +10 −5 wp-admin/user-edit.php
View
@@ -141,7 +141,7 @@ function use_ssl_preference($user) {
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 );
}
@@ -229,7 +229,7 @@ function use_ssl_preference($user) {
<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>
</tr>
-<?php if ( !IS_PROFILE_PAGE && !is_network_admin() ): ?>
+<?php if ( !IS_PROFILE_PAGE && !is_network_admin() ) : ?>
<tr><th><label for="role"><?php _e('Role:') ?></label></th>
<td><select name="role" id="role">
<?php
@@ -249,12 +249,17 @@ function use_ssl_preference($user) {
?>
</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>
-<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 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 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>

0 comments on commit d5f81d0

Please sign in to comment.