WordPress.org

Make WordPress Core

Changeset 13638


Ignore:
Timestamp:
03/09/2010 10:42:36 PM (12 years ago)
Author:
nacin
Message:

Expose a read-only network.php once multisite is enabled, to ensure access to original configuration such as rewrite rules. see #11816

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r13634 r13638  
    182182    if ( is_multisite() && ($current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path) )
    183183        $submenu['tools.php'][25] = array( __('Delete Blog'), 'manage_options', 'ms-delete-site.php' );
    184     if ( !is_multisite() && is_super_admin() && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE )
     184    if ( is_super_admin() && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE )
    185185        $submenu['tools.php'][50] = array(__('Network'), 'manage_options', 'network.php');
    186186
  • trunk/wp-admin/network.php

    r13637 r13638  
    1616if ( ! is_super_admin() )
    1717    wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
    18 
    19 if ( is_multisite() )
    20     wp_die( __( 'The Network feature is already enabled.' ) );
    2118
    2219include( ABSPATH . 'wp-admin/includes/network.php' );
     
    172169function network_step2() {
    173170    global $base, $wpdb;
    174     if ( ! $_POST ) : ?>
     171    if ( ! $_POST ) :
     172        if ( is_multisite() ) : ?>
     173    <div class="updated"><p><strong><?php _e( 'Notice: The Network feature is already enabled.' ); ?></strong> <?php _e( 'The original configuration steps are shown here for reference.' ); ?></p></div>
     174<?php   else : ?>
    175175    <div class="error"><p><strong><?php _e('Warning:'); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>
    176176    <p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p>
    177 <?php endif; ?>
    178177        <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
    179178        <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
    180179        <div class="updated inline"><p><?php _e( '<strong>Caution:</strong> We recommend you backup your existing <code>wp-config.php</code> and <code>.htaccess</code> files.' ); ?></p></div>
     180<?php
     181        endif;
     182    endif;
     183?>
    181184        <ol>
    182185            <li><p><?php printf( __( 'Create a <code>blogs.dir</code> directory in <code>%s</code>. This directory is used to stored uploaded media for your additional sites and must be writeable by the web server.' ), WP_CONTENT_DIR ); ?></p></li>
     
    251254</textarea></li>
    252255        </ol>
     256<?php if ( !is_multisite() ) { ?>
    253257        <p><?php printf( __( 'Once you complete these steps, your network is enabled and configured.') ); ?> <a href="<?php echo esc_url( admin_url() ); ?>"><?php _e( 'Return to Dashboard' ); ?></a></p>
    254258<?php
     259    }
    255260}
    256261
     
    270275    // create wp-config.php / htaccess
    271276    network_step2();
    272 } elseif ( network_domain_check() ) {
     277} elseif ( is_multisite() || network_domain_check() ) {
    273278    network_step2();
    274279} else {
Note: See TracChangeset for help on using the changeset viewer.