Make WordPress Core

Changeset 14003


Ignore:
Timestamp:
04/05/2010 02:59:10 AM (14 years ago)
Author:
wpmuguru
Message:

more manage_network_* caps, see #12109

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r13979 r14003  
    4040if ( !empty($action) ) {
    4141    $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' ) )
    4343        $network_wide = true;
    4444
     
    379379$network_plugins = array();
    380380$mustuse_plugins = $dropins_plugins = array();
    381 if ( ! is_multisite() || ( is_multisite() && current_user_can('manage_network_plugins') ) ) {
     381if ( ! is_multisite() || current_user_can('manage_network_plugins') ) {
    382382    if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
    383383        $mustuse_plugins = get_mu_plugins();
     
    407407foreach ( (array) $all_plugins as $plugin_file => $plugin_data) {
    408408    // 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;
    412414    } elseif ( is_plugin_active($plugin_file) ) {
    413415        $active_plugins[ $plugin_file ] = $plugin_data;
     
    570572                    $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
    571573
    572                 if ( is_multisite() && is_super_admin() )
     574                if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
    573575                    $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
    574576
  • trunk/wp-admin/user-edit.php

    r13941 r14003  
    5959
    6060// 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 ) )
     61if ( is_multisite() && ! current_user_can( 'manage_network_users' ) && $user_id != $current_user->ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) )
    6262    wp_die( __( 'You do not have permission to edit this user.' ) );
    6363
     
    122122        delete_user_meta( $user_id, $blog_prefix . 'capabilities' );
    123123
    124     if ( is_multisite() && is_super_admin() && !IS_PROFILE_PAGE )
     124    if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) )
    125125        empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
    126126}
     
    142142?>
    143143
    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' ) ) { ?>
    145145    <div class="updated"><p><strong><?php _e('Important:'); ?></strong> <?php _e('This user has super admin privileges.'); ?></p></div>
    146146<?php } ?>
     
    236236?>
    237237</select>
    238 <?php if ( is_multisite() && is_super_admin() ) { ?>
     238<?php if ( is_multisite() && current_user_can( 'manage_network_options' ) ) { ?>
    239239<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>
    240240<?php } ?>
Note: See TracChangeset for help on using the changeset viewer.