Changeset 14003
- Timestamp:
- 04/05/2010 02:59:10 AM (14 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/plugins.php
r13979 r14003 40 40 if ( !empty($action) ) { 41 41 $network_wide = false; 42 if ( ( isset( $_GET['networkwide'] ) || 'network-activate-selected' == $action ) && is_multisite() && is_super_admin() )42 if ( ( isset( $_GET['networkwide'] ) || 'network-activate-selected' == $action ) && is_multisite() && current_user_can( 'manage_network_plugins' ) ) 43 43 $network_wide = true; 44 44 … … 379 379 $network_plugins = array(); 380 380 $mustuse_plugins = $dropins_plugins = array(); 381 if ( ! is_multisite() || ( is_multisite() && current_user_can('manage_network_plugins')) ) {381 if ( ! is_multisite() || current_user_can('manage_network_plugins') ) { 382 382 if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) 383 383 $mustuse_plugins = get_mu_plugins(); … … 407 407 foreach ( (array) $all_plugins as $plugin_file => $plugin_data) { 408 408 // Filter into individual sections 409 if ( is_plugin_active_for_network($plugin_file) ) { 410 if ( is_super_admin() ) 411 $network_plugins[ $plugin_file ] = $plugin_data; 409 if ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) { 410 unset( $all_plugins[ $plugin_file ] ); 411 continue; 412 } elseif ( is_plugin_active_for_network($plugin_file) ) { 413 $network_plugins[ $plugin_file ] = $plugin_data; 412 414 } elseif ( is_plugin_active($plugin_file) ) { 413 415 $active_plugins[ $plugin_file ] = $plugin_data; … … 570 572 $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>'; 571 573 572 if ( is_multisite() && is_super_admin() )574 if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) 573 575 $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 574 576 -
trunk/wp-admin/user-edit.php
r13941 r14003 59 59 60 60 // Only allow super admins on multisite to edit every user. 61 if ( is_multisite() && ! is_super_admin() && $user_id != $current_user->ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) )61 if ( is_multisite() && ! current_user_can( 'manage_network_users' ) && $user_id != $current_user->ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) ) 62 62 wp_die( __( 'You do not have permission to edit this user.' ) ); 63 63 … … 122 122 delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); 123 123 124 if ( is_multisite() && is_super_admin() && !IS_PROFILE_PAGE)124 if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) ) 125 125 empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 126 126 } … … 142 142 ?> 143 143 144 <?php if ( !IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) ) { ?>144 <?php if ( !IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) && current_user_can( 'manage_network_options' ) ) { ?> 145 145 <div class="updated"><p><strong><?php _e('Important:'); ?></strong> <?php _e('This user has super admin privileges.'); ?></p></div> 146 146 <?php } ?> … … 236 236 ?> 237 237 </select> 238 <?php if ( is_multisite() && is_super_admin() ) { ?>238 <?php if ( is_multisite() && current_user_can( 'manage_network_options' ) ) { ?> 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 } ?>
Note: See TracChangeset
for help on using the changeset viewer.