Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15005 r15225  
    1010 * @subpackage Administration
    1111 */
     12
     13define( 'WP_NETWORK_ADMIN_PAGE', true );
    1214
    1315/** WordPress Administration Bootstrap */
     
    4446 */
    4547function allow_subdomain_install() {
    46     $domain = preg_replace( '|https?://[^/]|', '', get_option( 'siteurl' ) );
     48    $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'siteurl' ) );
    4749    if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) )
    4850        return false;
     
    5961    global $wpdb;
    6062    if ( apply_filters( 'allow_subdirectory_install', false ) )
     63        return true;
     64
     65    if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL )
    6166        return true;
    6267
     
    8893$parent_file = 'tools.php';
    8994
    90 add_contextual_help($current_screen, 
    91     '<p>' . __('This screen allows you to configure a network as having subdomains (site1.example.com) or subdirectories (example.com/site1). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.') . '</p>' .
     95add_contextual_help($current_screen,
     96    '<p>' . __('This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.') . '</p>' .
    9297    '<p>' . __('Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your install. Fill out the network details, and click install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).') . '</p>' .
    9398    '<p>' . __('The next screen for Network will give you individually-generated lines of code to add to your wp-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.') . '</p>' .
    94     '<p>' . __('Add a blogs.dir directory under /wp-content/ and add the designated lines of code to wp-config.php (just before /*...stop editing...*/) and .htaccess (replacing the existing WordPress rules).') . '</p>' .
     99    '<p>' . __('Add a <code>blogs.dir</code> directory under <code>/wp-content</code> and add the designated lines of code to wp-config.php (just before <code>/*...stop editing...*/</code>) and <code>.htaccess</code> (replacing the existing WordPress rules).') . '</p>' .
    95100    '<p>' . __('Refreshing your browser will take you to a screen with an archive of those added lines of code. A set of six links under Super Admin will appear at the top of the main left navigation menu. The multisite network is now enabled.') . '</p>' .
    96101    '<p>' . __('The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with &#8220;/blog/&#8221; from the main site. This disabling will be addressed soon in a future version.') . '</p>' .
    97102    '<p><strong>' . __('For more information:') . '</strong></p>' .
    98     '<p>' . __('<a href="http://codex.wordpress.org/Create_A_Network">General Network Creation Documentation</a>') . '</p>' .
    99     '<p>' . __('<a href="http://codex.wordpress.org/Tools_Network_SubPanel">Tools > Network Documentation</a>') . '</p>' .
    100     '<p>' . __('<a href="http://wordpress.org/support/">Support Forums</a>') . '</p>'
     103    '<p>' . __('<a href="http://codex.wordpress.org/Create_A_Network" target="_blank">General Network Creation Documentation</a>') . '</p>' .
     104    '<p>' . __('<a href="http://codex.wordpress.org/Tools_Network_SubPanel" target="_blank">Tools > Network Documentation</a>') . '</p>' .
     105    '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    101106);
    102107
     
    117122 */
    118123function network_step1( $errors = false ) {
     124    global $is_apache;
    119125
    120126    if ( get_option( 'siteurl' ) != get_option( 'home' ) ) {
     
    127133    $active_plugins = get_option( 'active_plugins' );
    128134    if ( ! empty( $active_plugins ) ) {
    129         echo '<div class="updated"><p><strong>' . __('Warning:') . '</strong> ' . sprintf( __( 'Please <a href="%s">deactivate your plugins</a> before enabling the Network feature.' ), admin_url( 'plugins.php?plugin_status=active' ) ) . '</p></div><p>' . __(' Once the network is created, you may reactivate your plugins.' ) . '</p>';
     135        echo '<div class="updated"><p><strong>' . __('Warning:') . '</strong> ' . sprintf( __( 'Please <a href="%s">deactivate your plugins</a> before enabling the Network feature.' ), admin_url( 'plugins.php?plugin_status=active' ) ) . '</p></div><p>' . __( 'Once the network is created, you may reactivate your plugins.' ) . '</p>';
    130136        echo '</div>';
    131137        include( './admin-footer.php' );
     
    167173    <?php
    168174
    169     // @todo IIS and ! $is_apache
    170175    if ( isset( $_POST['subdomain_install'] ) ) {
    171176        $subdomain_install = (bool) $_POST['subdomain_install'];
     
    176181    } else {
    177182        $subdomain_install = false;
    178         if ( got_mod_rewrite() ) // dangerous assumptions
     183        if ( $got_mod_rewrite = got_mod_rewrite() ) // dangerous assumptions
    179184            echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> ' . __( 'Please make sure the Apache <code>mod_rewrite</code> module is installed as it will be used at the end of this installation.' ) . '</p>';
    180         else
     185        elseif ( $is_apache )
    181186            echo '<div class="error inline"><p><strong>' . __( 'Warning!' ) . '</strong> ' . __( 'It looks like the Apache <code>mod_rewrite</code> module is not installed.' ) . '</p>';
    182         echo '<p>' . __( 'If <code>mod_rewrite</code> is disabled, ask your administrator to enable that module, or look at the <a href="http://httpd.apache.org/docs/mod/mod_rewrite.html">Apache documentation</a> or <a href="http://www.google.com/search?q=apache+mod_rewrite">elsewhere</a> for help setting it up.' ) . '</p></div>';
     187        if ( $got_mod_rewrite || $is_apache ) // Protect against mod_rewrite mimicry (but ! Apache)
     188            echo '<p>' . __( 'If <code>mod_rewrite</code> is disabled, ask your administrator to enable that module, or look at the <a href="http://httpd.apache.org/docs/mod/mod_rewrite.html">Apache documentation</a> or <a href="http://www.google.com/search?q=apache+mod_rewrite">elsewhere</a> for help setting it up.' ) . '</p></div>';
    183189    }
    184190
     
    308314        <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
    309315        <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
    310         <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>
     316        <div class="updated inline"><p><?php
     317            if ( iis7_supports_permalinks() )
     318                _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' );
     319            else
     320                _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>.htaccess</code> files.' );
     321        ?></p></div>
    311322<?php
    312323    }
     
    359370</li>
    360371<?php
    361     if (iis7_supports_permalinks()) {
    362             if (is_subdomain_install()) {
     372    if ( iis7_supports_permalinks() ) :
     373
     374            if ( $subdomain_install ) {
    363375                $web_config_file =
    364376'<?xml version="1.0" encoding="UTF-8"?>
     
    441453        </textarea></li>
    442454        </ol>
    443     <?php } else {
    444         // Construct an htaccess file.
     455
     456    <?php else : // end iis7_supports_permalinks(). construct an htaccess file instead:
     457
    445458        $htaccess_file = 'RewriteEngine On
    446459RewriteBase ' . $base . '
     
    465478        ?>
    466479        <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
    467         <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"><?php
    468         echo wp_htmledit_pre( $htaccess_file );
    469         ?>
    470         </textarea></li>
     480        <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>">
     481<?php echo wp_htmledit_pre( $htaccess_file ); ?></textarea></li>
    471482        </ol>
    472     <?php }
     483
     484    <?php endif; // end IIS/Apache code branches.
     485
    473486    if ( !is_multisite() ) { ?>
    474487        <p><?php printf( __( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.') ); ?> <a href="<?php echo esc_url( site_url( 'wp-login.php' ) ); ?>"><?php _e( 'Log In' ); ?></a></p>
Note: See TracChangeset for help on using the changeset viewer.