Make WordPress Core

Changeset 21740


Ignore:
Timestamp:
09/04/2012 08:51:33 PM (14 years ago)
Author:
nacin
Message:

Only allow operations on network plugins through the network admin. see #21187, for trunk.

File:
1 edited

Legend:

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

    r21198 r21740  
    4545
    4646                        if ( ! is_network_admin() ) {
     47                                if ( is_network_only_plugin( $plugin ) ) {
     48                                        wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
     49                                        exit;
     50                                }
     51
    4752                                $recent = (array) get_option( 'recently_activated' );
    4853                                unset( $recent[ $plugin ] );
    … …  
    6671
    6772                        // Only activate plugins which are not already active.
    68                         $check = is_network_admin() ? 'is_plugin_active_for_network' : 'is_plugin_active';
    69                         foreach ( $plugins as $i => $plugin )
    70                                 if ( $check( $plugin ) )
    71                                         unset( $plugins[ $i ] );
     73                        if ( is_network_admin() ) {
     74                                foreach ( $plugins as $i => $plugin ) {
     75                                        if ( is_plugin_active_for_network( $plugin ) )
     76                                                unset( $plugins[ $i ] );
     77                                }
     78                        } else {
     79                                foreach ( $plugins as $i => $plugin ) {
     80                                        if ( is_plugin_active( $plugin ) || is_network_only_plugin( $plugin ) )
     81                                                unset( $plugins[ $i ] );
     82                                }
     83                        }
    7284
    7385                        if ( empty($plugins) ) {
Note: See TracChangeset for help on using the changeset viewer.