Changeset 14043
- Timestamp:
- 04/09/2010 08:26:16 AM (14 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r14042 r14043 819 819 update_site_option( 'site_admins' , $super_admins ); 820 820 do_action( 'granted_super_admin', $user_id ); 821 } 821 return true; 822 } 823 return false; 822 824 } 823 825 … … 831 833 do_action( 'revoke_super_admin', $user_id ); 832 834 833 $admin_email = get_site_option( 'admin_email' );834 835 $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); 835 836 836 $user = new WP_User( $user_id ); 837 if ( $user->user_email != $admin_email ) { 838 foreach ( $super_admins as $key => $username ) { 839 if ( $username == $user->user_login ) { 840 unset( $super_admins[$key] ); 841 update_site_option( 'site_admins' , $super_admins ); 842 do_action( 'revoked_super_admin', $user_id ); 843 break; 844 } 845 } 846 } 837 if ( $user->user_email != get_site_option( 'admin_email' ) ) { 838 if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) { 839 unset( $super_admins[$key] ); 840 update_site_option( 'site_admins', $super_admins ); 841 do_action( 'revoked_super_admin', $user_id ); 842 return true; 843 } 844 } 845 return false; 847 846 } 848 847 ?> -
trunk/wp-admin/user-edit.php
r14003 r14043 122 122 delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); 123 123 124 if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) )124 if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) 125 125 empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 126 126 }
Note: See TracChangeset
for help on using the changeset viewer.