mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-10 12:10:12 +00:00
more manage_network_* caps, see #12109
git-svn-id: https://develop.svn.wordpress.org/trunk@14003 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -58,7 +58,7 @@ function use_ssl_preference($user) {
|
||||
|
||||
|
||||
// Only allow super admins on multisite to edit every user.
|
||||
if ( is_multisite() && ! is_super_admin() && $user_id != $current_user->ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) )
|
||||
if ( is_multisite() && ! current_user_can( 'manage_network_users' ) && $user_id != $current_user->ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) )
|
||||
wp_die( __( 'You do not have permission to edit this user.' ) );
|
||||
|
||||
// Execute confirmed email change. See send_confirmation_on_profile_email().
|
||||
@@ -121,7 +121,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_super_admin() && !IS_PROFILE_PAGE )
|
||||
if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) )
|
||||
empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ if ( !current_user_can('edit_user', $user_id) )
|
||||
include ('admin-header.php');
|
||||
?>
|
||||
|
||||
<?php if ( !IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) ) { ?>
|
||||
<?php if ( !IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) && current_user_can( 'manage_network_options' ) ) { ?>
|
||||
<div class="updated"><p><strong><?php _e('Important:'); ?></strong> <?php _e('This user has super admin privileges.'); ?></p></div>
|
||||
<?php } ?>
|
||||
<?php if ( isset($_GET['updated']) ) : ?>
|
||||
@@ -235,7 +235,7 @@ else
|
||||
echo '<option value="" selected="selected">' . __('— No role for this blog —') . '</option>';
|
||||
?>
|
||||
</select>
|
||||
<?php if ( is_multisite() && is_super_admin() ) { ?>
|
||||
<?php if ( is_multisite() && current_user_can( 'manage_network_options' ) ) { ?>
|
||||
<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 } ?>
|
||||
</td></tr>
|
||||
|
||||
Reference in New Issue
Block a user