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