Changeset 13633
- Timestamp:
- 03/09/2010 06:58:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network.php
r13622 r13633 82 82 83 83 wp_nonce_field( 'install-network-1' ); 84 if ( network_domain_check() ) { ?> 85 <h3><?php esc_html_e( 'Existing Network' ); ?></h3> 86 <div class="updated inline"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'An existing network was detected.' ); ?></p></div> 87 <p class="existing-network"> 88 <label><input type='checkbox' name='existing_network' value='1' /> <?php _e( 'Yes, keep the existing network of sites.' ); ?></label><br /> 89 </p> 90 <?php } else { ?> 91 <input type='hidden' name='existing_network' value='0' /> 92 <?php } ?> 93 <input type='hidden' name='action' value='step2' /> 94 <?php if ( 'localhost' != $hostname ) : ?> 84 85 if ( 'localhost' != $hostname ) : ?> 95 86 <h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3> 96 87 <p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories. <strong>You cannot change this later.</strong>' ); ?></p> … … 111 102 </table> 112 103 113 114 104 <?php 105 endif; 115 106 116 107 $is_www = ( substr( $hostname, 0, 4 ) == 'www.' ); … … 172 163 function network_step2() { 173 164 global $base, $wpdb; 174 ?> 165 if ( ! $_POST ) : ?> 166 <div class="error"><p><strong><?php _e('Warning:'); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div> 167 <p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p> 168 <?php endif; ?> 175 169 <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 176 170 <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> … … 252 246 } 253 247 254 $action = isset( $_POST['action'] ) ? $_POST['action'] : null; 255 256 switch ( $action ) { 257 case 'step2': 258 check_admin_referer( 'install-network-1' ); 259 260 // Install! 261 $base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) ); 262 263 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 264 // create network tables 265 install_network(); 266 $hostname = get_clean_basedomain(); 267 $vhost = 'localhost' == $hostname ? false : (bool) $_POST['vhost']; 268 if ( !network_domain_check() || isset( $_POST['existing_network'] ) && $_POST['existing_network'] == '0' ) 269 populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), $_POST['weblog_title'], $base, $vhost ); 270 // create wp-config.php / htaccess 271 network_step2(); 272 break; 273 274 default: 275 network_step1(); 276 break; 248 if ( $_POST ) { 249 check_admin_referer( 'install-network-1' ); 250 251 // Install! 252 $base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) ); 253 254 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 255 // create network tables 256 install_network(); 257 $hostname = get_clean_basedomain(); 258 $vhost = 'localhost' == $hostname ? false : (bool) $_POST['vhost']; 259 if ( ! network_domain_check() ) 260 populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), $_POST['weblog_title'], $base, $vhost ); 261 // create wp-config.php / htaccess 262 network_step2(); 263 } elseif ( network_domain_check() ) { 264 network_step2(); 265 } else { 266 network_step1(); 277 267 } 278 268 ?>
Note: See TracChangeset
for help on using the changeset viewer.