mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Introduce get_super_admins(). Allow hard-coding a global super_admins array and bypassing site options. fixes #12815
git-svn-id: https://develop.svn.wordpress.org/trunk@14206 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )
|
||||
if ( is_multisite() && !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 );
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ else
|
||||
echo '<option value="" selected="selected">' . __('— No role for this blog —') . '</option>';
|
||||
?>
|
||||
</select>
|
||||
<?php if ( is_multisite() && current_user_can( 'manage_network_options' ) ) { ?>
|
||||
<?php if ( is_multisite() && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
|
||||
<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