Changes in trunk/wp-admin/network.php [15225:17323]
- File:
-
- 1 edited
-
trunk/wp-admin/network.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network.php
r15225 r17323 19 19 wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); 20 20 21 if ( is_multisite() && ! defined( 'MULTISITE' ) ) 22 wp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) ); 21 if ( is_multisite() ) { 22 if ( ! is_network_admin() ) { 23 wp_redirect( network_admin_url( 'setup.php' ) ); 24 exit; 25 } 26 if ( ! defined( 'MULTISITE' ) ) 27 wp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) ); 28 } 23 29 24 30 // We need to create references to ms global tables to enable Network. … … 90 96 wp_die( __( 'You must define the <code>WP_ALLOW_MULTISITE</code> constant as true in your wp-config.php file to allow creation of a Network.' ) ); 91 97 92 $title = __( 'Create a Network of WordPress Sites' ); 93 $parent_file = 'tools.php'; 98 if ( is_network_admin() ) { 99 $title = __( 'Network Setup' ); 100 $parent_file = 'settings.php'; 101 } else { 102 $title = __( 'Create a Network of WordPress Sites' ); 103 $parent_file = 'tools.php'; 104 } 94 105 95 106 add_contextual_help($current_screen, … … 101 112 '<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 113 '<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>' .114 '<p>' . __('<a href="http://codex.wordpress.org/Create_A_Network" target="_blank">Documentation on Creating a Network</a>') . '</p>' . 115 '<p>' . __('<a href="http://codex.wordpress.org/Tools_Network_SubPanel" target="_blank">Documentation on the Network Screen</a>') . '</p>' . 105 116 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 106 117 ); 107 118 108 include( './admin-header.php' );119 include( ABSPATH . 'wp-admin/admin-header.php' ); 109 120 ?> 110 121 <div class="wrap"> 111 <?php screen_icon( ); ?>122 <?php screen_icon('tools'); ?> 112 123 <h2><?php echo esc_html( $title ); ?></h2> 113 124 … … 127 138 echo '<div class="error"><p><strong>' . __('Error:') . '</strong> ' . sprintf( __( 'Your <strong>WordPress address</strong> must match your <strong>Site address</strong> before creating a Network. See <a href="%s">General Settings</a>.' ), esc_url( admin_url( 'options-general.php' ) ) ) . '</p></div>'; 128 139 echo '</div>'; 129 include ('./admin-footer.php' ); 140 include ( ABSPATH . 'wp-admin/admin-footer.php' ); 141 die(); 142 } 143 144 if ( defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) { 145 echo '<div class="error"><p><strong>' . __('Error:') . '</strong> ' . __( 'The constant DO_NOT_UPGRADE_GLOBAL_TABLES cannot be defined when creating a network.' ) . '</p></div>'; 146 echo '</div>'; 147 include ( ABSPATH . 'wp-admin/admin-footer.php' ); 130 148 die(); 131 149 } … … 135 153 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 154 echo '</div>'; 137 include( './admin-footer.php' );155 include( ABSPATH . 'wp-admin/admin-footer.php' ); 138 156 die(); 139 157 } … … 146 164 echo '<a href="' . esc_url( admin_url() ) . '">' . __( 'Return to Dashboard' ) . '</a>'; 147 165 echo '</div>'; 148 include( './admin-footer.php' );166 include( ABSPATH . 'wp-admin/admin-footer.php' ); 149 167 die(); 150 168 } … … 276 294 </tr> 277 295 </table> 278 < p class='submit'><input class="button-primary" name='submit' type='submit' value='<?php esc_attr_e( 'Install' ); ?>' /></p>296 <?php submit_button( __( 'Install' ), 'primary', 'submit' ); ?> 279 297 </form> 280 <?php298 <?php 281 299 } 282 300 … … 290 308 $hostname = get_clean_basedomain(); 291 309 310 if ( ! isset( $base ) ) 311 $base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) ); 312 292 313 // Wildcard DNS message. 293 314 if ( is_wp_error( $errors ) ) … … 295 316 296 317 if ( $_POST ) { 297 $subdomain_install = allow_subdomain_install() ? ( allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true ) : false; 318 if ( allow_subdomain_install() ) 319 $subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true; 320 else 321 $subdomain_install = false; 298 322 } else { 299 323 if ( is_multisite() ) { 300 324 $subdomain_install = is_subdomain_install(); 301 325 ?> 302 <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> 303 <?php } else { 326 <p><?php _e( 'The original configuration steps are shown here for reference.' ); ?></p> 327 <?php 328 } else { 304 329 $subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); 305 330 ?> … … 315 340 <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> 316 341 <div class="updated inline"><p><?php 317 if ( iis7_supports_permalinks() ) 342 if ( file_exists( ABSPATH . '.htaccess' ) ) 343 printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' ); 344 elseif ( file_exists( ABSPATH . 'web.config' ) ) 345 printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' ); 346 else 318 347 _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' ); 319 else320 _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>.htaccess</code> files.' );321 348 ?></p></div> 322 349 <?php … … 325 352 <ol> 326 353 <li><p><?php 327 printf( __( 'Create a <code>blogs.dir</code> directory in <code>%s</code>. This directory is used to storeduploaded media for your additional sites and must be writeable by the web server.' ), WP_CONTENT_DIR );354 printf( __( 'Create a <code>blogs.dir</code> directory at <code>%s/blogs.dir</code>. This directory is used to store uploaded media for your additional sites and must be writeable by the web server.' ), WP_CONTENT_DIR ); 328 355 if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' ) 329 356 echo ' <strong>' . __('Warning:') . ' ' . __( 'Networks may not be fully compatible with custom wp-content directories.' ) . '</strong'; … … 345 372 } 346 373 if ( ! empty( $keys_salts ) ) { 374 $keys_salts_str = ''; 347 375 $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); 348 376 if ( is_wp_error( $from_api ) ) { 349 377 foreach ( $keys_salts as $c => $v ) { 350 $keys_salts [ $c ] = wp_generate_password( 64, true, true );378 $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );"; 351 379 } 352 380 } else { 353 381 $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); 354 382 foreach ( $keys_salts as $c => $v ) { 355 $keys_salts [ $c ] = substr( array_shift( $from_api ), 28, 64 );383 $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );"; 356 384 } 357 385 } … … 360 388 <p><?php 361 389 echo _n( 'This unique authentication key is also missing from your <code>wp-config.php</code> file.', 'These unique authentication keys are also missing from your <code>wp-config.php</code> file.', $num_keys_salts ); ?> <?php _e( 'To make your installation more secure, you should also add:' ) ?></p> 362 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php 363 foreach ( $keys_salts as $c => $v ) { 364 echo "\ndefine( '$c', '$v' );"; 365 } 366 ?></textarea> 390 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea> 367 391 <?php 368 392 } … … 431 455 </rule> 432 456 <rule name="WordPress Rule 5" stopProcessing="true"> 433 <match url="^ ([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />457 <match url="^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*)" ignoreCase="false" /> 434 458 <action type="Rewrite" url="{R:2}" /> 435 459 </rule> … … 450 474 <li><p><?php printf( __( 'Add the following to your <code>web.config</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 451 475 <textarea class="code" readonly="readonly" cols="100" rows="20"> 452 <?php echo wp_htmledit_pre( $web_config_file ); ?>476 <?php echo esc_textarea( $web_config_file ); ?> 453 477 </textarea></li> 454 478 </ol> … … 472 496 // @todo custom content dir. 473 497 if ( ! $subdomain_install ) 474 $htaccess_file .= "\nRewriteRule ^ ([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2[L]";498 $htaccess_file .= "\nRewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]\nRewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]"; 475 499 476 500 $htaccess_file .= "\nRewriteRule . index.php [L]"; … … 479 503 <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 480 504 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>"> 481 <?php echo wp_htmledit_pre( $htaccess_file ); ?></textarea></li>505 <?php echo esc_textarea( $htaccess_file ); ?></textarea></li> 482 506 </ol> 483 507 … … 490 514 } 491 515 492 $base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) );493 494 516 if ( $_POST ) { 517 518 $base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) ); 519 495 520 check_admin_referer( 'install-network-1' ); 496 521 … … 521 546 </div> 522 547 523 <?php include( './admin-footer.php' ); ?>548 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
Note: See TracChangeset
for help on using the changeset viewer.