Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15225 r15005  
    1010 * @subpackage Administration
    1111 */
    12 
    13 define( 'WP_NETWORK_ADMIN_PAGE', true );
    1412
    1513/** WordPress Administration Bootstrap */
     
    4644 */
    4745function allow_subdomain_install() {
    48     $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'siteurl' ) );
     46    $domain = preg_replace( '|https?://[^/]|', '', get_option( 'siteurl' ) );
    4947    if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) )
    5048        return false;
     
    6159    global $wpdb;
    6260    if ( apply_filters( 'allow_subdirectory_install', false ) )
    63         return true;
    64 
    65     if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL )
    6661        return true;
    6762
     
    9388$parent_file = 'tools.php';
    9489
    95 add_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>' .
     90add_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>' .
    9792    '<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>' .
    9893    '<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>' .
    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>' .
     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>' .
    10095    '<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>' .
    10196    '<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>' .
    10297    '<p><strong>' . __('For more information:') . '</strong></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>'
     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>'
    106101);
    107102
     
    122117 */
    123118function network_step1( $errors = false ) {
    124     global $is_apache;
    125119
    126120    if ( get_option( 'siteurl' ) != get_option( 'home' ) ) {
     
    133127    $active_plugins = get_option( 'active_plugins' );
    134128    if ( ! empty( $active_plugins ) ) {
    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>';
     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>';
    136130        echo '</div>';
    137131        include( './admin-footer.php' );
     
    173167    <?php
    174168
     169    // @todo IIS and ! $is_apache
    175170    if ( isset( $_POST['subdomain_install'] ) ) {
    176171        $subdomain_install = (bool) $_POST['subdomain_install'];
     
    181176    } else {
    182177        $subdomain_install = false;
    183         if ( $got_mod_rewrite = got_mod_rewrite() ) // dangerous assumptions
     178        if ( got_mod_rewrite() ) // dangerous assumptions
    184179            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>';
    185         elseif ( $is_apache )
     180        else
    186181            echo '<div class="error inline"><p><strong>' . __( 'Warning!' ) . '</strong> ' . __( 'It looks like the Apache <code>mod_rewrite</code> module is not installed.' ) . '</p>';
    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>';
     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>';
    189183    }
    190184
     
    314308        <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
    315309        <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
    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>
     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>
    322311<?php
    323312    }
     
    370359</li>
    371360<?php
    372     if ( iis7_supports_permalinks() ) :
    373 
    374             if ( $subdomain_install ) {
     361    if (iis7_supports_permalinks()) {
     362            if (is_subdomain_install()) {
    375363                $web_config_file =
    376364'<?xml version="1.0" encoding="UTF-8"?>
     
    453441        </textarea></li>
    454442        </ol>
    455 
    456     <?php else : // end iis7_supports_permalinks(). construct an htaccess file instead:
    457 
     443    <?php } else {
     444        // Construct an htaccess file.
    458445        $htaccess_file = 'RewriteEngine On
    459446RewriteBase ' . $base . '
     
    478465        ?>
    479466        <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
    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>
     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>
    482471        </ol>
    483 
    484     <?php endif; // end IIS/Apache code branches.
    485 
     472    <?php }
    486473    if ( !is_multisite() ) { ?>
    487474        <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.