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