Changeset 14206
- Timestamp:
- 04/23/2010 08:34:03 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r14177 r14206 188 188 <?php 189 189 wp_nonce_field( 'ms-users-delete' ); 190 $site_admins = get_s ite_option( 'site_admins', array( 'admin' ));190 $site_admins = get_super_admins(); 191 191 $admin_out = "<option value='$current_user->ID'>$current_user->user_login</option>"; 192 192 … … 812 812 */ 813 813 function grant_super_admin( $user_id ) { 814 global $super_admins; 815 816 // If global super_admins override is defined, there is nothing to do here. 817 if ( isset($super_admins) ) 818 return false; 819 814 820 do_action( 'grant_super_admin', $user_id ); 815 821 822 // Directly fetch site_admins instead of using get_super_admins() 816 823 $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); 817 824 … … 833 840 */ 834 841 function revoke_super_admin( $user_id ) { 842 global $super_admins; 843 844 // If global super_admins override is defined, there is nothing to do here. 845 if ( isset($super_admins) ) 846 return false; 847 835 848 do_action( 'revoke_super_admin', $user_id ); 836 849 850 // Directly fetch site_admins instead of using get_super_admins() 837 851 $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); 852 838 853 $user = new WP_User( $user_id ); 839 854 if ( $user->user_email != get_site_option( 'admin_email' ) ) { -
trunk/wp-admin/ms-edit.php
r14102 r14206 532 532 case 'spam': 533 533 $user = new WP_User( $val ); 534 if ( in_array( $user->user_login, get_s ite_option( 'site_admins', array( 'admin' )) ) )534 if ( in_array( $user->user_login, get_super_admins() ) ) 535 535 wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network admnistrator.' ), esc_html( $user->user_login ) ) ); 536 536 -
trunk/wp-admin/ms-users.php
r14188 r14206 200 200 <?php if ( $user_list ) { 201 201 $class = ''; 202 $super_admins = get_s ite_option( 'site_admins');202 $super_admins = get_super_admins(); 203 203 foreach ( (array) $user_list as $user ) { 204 204 $class = ( 'alternate' == $class ) ? '' : 'alternate'; -
trunk/wp-admin/user-edit.php
r14171 r14206 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' ) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )124 if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && 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 } … … 236 236 ?> 237 237 </select> 238 <?php if ( is_multisite() && current_user_can( 'manage_network_options' ) ) { ?>238 <?php if ( is_multisite() && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?> 239 239 <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> 240 240 <?php } ?> -
trunk/wp-includes/capabilities.php
r14189 r14206 1172 1172 1173 1173 /** 1174 * Retrieve a list of super admins. 1175 * 1176 * @since 3.0.0 1177 * 1178 * @uses $super_admins Super admins global variable, if set. 1179 * 1180 * @return array List of super admin logins 1181 */ 1182 function get_super_admins() { 1183 global $super_admins; 1184 1185 if ( isset($super_admins) ) 1186 return $super_admins; 1187 else 1188 return get_site_option( 'site_admins', array('admin') ); 1189 } 1190 1191 /** 1174 1192 * Determine if user is a site admin. 1175 1193 * … … 1191 1209 1192 1210 if ( is_multisite() ) { 1193 $s ite_admins = get_site_option( 'site_admins', array('admin'));1194 if ( is_array( $s ite_admins ) && in_array( $user->user_login, $site_admins ) )1211 $super_admins = get_super_admins(); 1212 if ( is_array( $super_admins ) && in_array( $user->user_login, $super_admins ) ) 1195 1213 return true; 1196 1214 } else {
Note: See TracChangeset
for help on using the changeset viewer.