Changes in trunk/wp-admin/network.php [15225:15005]
- File:
-
- 1 edited
-
trunk/wp-admin/network.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network.php
r15225 r15005 10 10 * @subpackage Administration 11 11 */ 12 13 define( 'WP_NETWORK_ADMIN_PAGE', true );14 12 15 13 /** WordPress Administration Bootstrap */ … … 46 44 */ 47 45 function allow_subdomain_install() { 48 $domain = preg_replace( '|https?:// ([^/]+)|', '$1', get_option( 'siteurl' ) );46 $domain = preg_replace( '|https?://[^/]|', '', get_option( 'siteurl' ) ); 49 47 if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) ) 50 48 return false; … … 61 59 global $wpdb; 62 60 if ( apply_filters( 'allow_subdirectory_install', false ) ) 63 return true;64 65 if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL )66 61 return true; 67 62 … … 93 88 $parent_file = 'tools.php'; 94 89 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>' .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>' . 97 92 '<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>' . 98 93 '<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>' . 100 95 '<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>' . 101 96 '<p>' . __('The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with “/blog/” from the main site. This disabling will be addressed soon in a future version.') . '</p>' . 102 97 '<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>' 106 101 ); 107 102 … … 122 117 */ 123 118 function network_step1( $errors = false ) { 124 global $is_apache;125 119 126 120 if ( get_option( 'siteurl' ) != get_option( 'home' ) ) { … … 133 127 $active_plugins = get_option( 'active_plugins' ); 134 128 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>'; 136 130 echo '</div>'; 137 131 include( './admin-footer.php' ); … … 173 167 <?php 174 168 169 // @todo IIS and ! $is_apache 175 170 if ( isset( $_POST['subdomain_install'] ) ) { 176 171 $subdomain_install = (bool) $_POST['subdomain_install']; … … 181 176 } else { 182 177 $subdomain_install = false; 183 if ( $got_mod_rewrite =got_mod_rewrite() ) // dangerous assumptions178 if ( got_mod_rewrite() ) // dangerous assumptions 184 179 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 else if ( $is_apache )180 else 186 181 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>'; 189 183 } 190 184 … … 314 308 <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 315 309 <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> 322 311 <?php 323 312 } … … 370 359 </li> 371 360 <?php 372 if ( iis7_supports_permalinks() ) : 373 374 if ( $subdomain_install ) { 361 if (iis7_supports_permalinks()) { 362 if (is_subdomain_install()) { 375 363 $web_config_file = 376 364 '<?xml version="1.0" encoding="UTF-8"?> … … 453 441 </textarea></li> 454 442 </ol> 455 456 <?php else : // end iis7_supports_permalinks(). construct an htaccess file instead: 457 443 <?php } else { 444 // Construct an htaccess file. 458 445 $htaccess_file = 'RewriteEngine On 459 446 RewriteBase ' . $base . ' … … 478 465 ?> 479 466 <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> 482 471 </ol> 483 484 <?php endif; // end IIS/Apache code branches. 485 472 <?php } 486 473 if ( !is_multisite() ) { ?> 487 474 <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.