Changeset 12759
- Timestamp:
- 01/19/2010 04:14:06 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/schema.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/schema.php
r12756 r12759 320 320 // 3.0 multisite 321 321 if ( is_multisite() ) { 322 $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), $current_site->site_name );323 $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/';322 $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), $current_site->site_name ); 323 $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/'; 324 324 } 325 325 … … 624 624 625 625 //@todo: turn these checks into returned messages 626 if ( $domain == '' )626 if ( $domain == '' ) 627 627 die( 'You must provide a domain name!' ); 628 if ( $site_name == '' )628 if ( $site_name == '' ) 629 629 die( 'You must provide a site name!' ); 630 630 631 631 // check for network collision 632 632 $existing_network = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$wpdb->site} WHERE id = %d", $network_id ) ); 633 if ( $existing_network == $network_id )633 if ( $existing_network == $network_id ) 634 634 die( 'That network already exists!' ); 635 635 636 636 $site_user = get_user_by_email( $email ); 637 if ( !$site_user )637 if ( !$site_user ) 638 638 die( 'You must provide an email address!' ); 639 639 // set up site tables 640 640 $template = get_option( 'template' ); 641 641 $stylesheet = get_option( 'stylesheet' ); 642 if ( $template != $stylesheet ) {642 if ( $template != $stylesheet ) 643 643 $allowed_themes = array( $template, $stylesheet ); 644 } else {644 else 645 645 $allowed_themes = array( $stylesheet ); 646 } 646 647 647 $wpdb->query( $wpdb->prepare( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'site_name', %s)", $network_id, $site_name ) ); 648 648 $wpdb->query( $wpdb->prepare( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'admin_email', %s)", $network_id, $site_user->user_email ) ); … … 662 662 if ( $users ) { 663 663 foreach ( $users as $user ) { 664 if ( is_super_admin( $user->ID ) && !in_array( $user->user_login, $site_admins ) ) {664 if ( is_super_admin( $user->ID ) && !in_array( $user->user_login, $site_admins ) ) 665 665 $site_admins[] = $user->user_login; 666 }667 666 } 668 667 } … … 701 700 } 702 701 703 if ( $vhost == 'yes' ) {702 if ( $vhost == 'yes' ) 704 703 update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/'); 705 } else {704 else 706 705 update_option( 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/'); 707 } 706 708 707 $wp_rewrite->flush_rules(); 709 708 … … 712 711 $hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname! 713 712 $page = wp_remote_get( 'http://' . $hostname, array( 'timeout' => 5, 'httpversion' => '1.1' ) ); 714 if ( is_object( $page ) && is_wp_error( $page ) ) {715 foreach ( $page->get_error_messages() as $err ) 713 if ( is_object( $page ) && is_wp_error( $page ) ) { 714 foreach ( $page->get_error_messages() as $err ) { 716 715 $errstr = $err; 716 } 717 717 } elseif( $page[ 'response' ][ 'code' ] == 200 ) { 718 718 $vhost_ok = true; 719 719 } 720 if ( !$vhost_ok ) {720 if ( !$vhost_ok ) { 721 721 $msg = "<h2>Warning! Wildcard DNS may not be configured correctly!</h2>"; 722 722 $msg .= "<p>To use the subdomain feature of WordPress MU you must have a wildcard entry in your dns. The installer attempted to contact a random hostname ($hostname) on your domain but failed. It returned this error message:<br /> <strong>$errstr</strong></p><p>From the README.txt:</p>"; … … 728 728 return $msg; 729 729 } 730 730 731 ?>
Note: See TracChangeset
for help on using the changeset viewer.