Changeset 589

Show
Ignore:
Timestamp:
06/22/06 12:30:48 (2 years ago)
Author:
donncha
Message:

More VHOST/sub-dirs changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/index.php

    r584 r589  
    265265    $prefix  = 'wp_'; 
    266266    $base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) ); 
     267    if( $base != "/") { 
     268           $base .= "/"; 
     269    }  
    267270 
    268271    // Test the db connection. 
     
    298301                fwrite($handle, str_replace("localhost", $dbhost, $line)); 
    299302            break; 
    300             case "define('VHOST', ": 
     303            case "define('VHOST',": 
    301304                fwrite($handle, str_replace("VHOSTSETTING", $vhost, $line)); 
    302305            break; 
     
    322325        <form method='post' action='index.php'>  
    323326        <input type='hidden' name='action' value='step3'> 
    324         <p>To finish setting up your blog, please fill in the folling form and click <q>Submit</q>.</p> 
     327        <p>To finish setting up your blog, please fill in the following form and click <q>Submit</q>.</p> 
    325328        <h2>Server Address</h2> 
    326         <p><label>What is the Internet address of your site? <input type='text' name='basedomain' value='{$hostname}'><br />You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box above.</label></p> 
     329        <p><label>What is the Internet address of your site? You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box above.<br /><b>Server Address:</b> <input type='text' name='basedomain' value='{$hostname}'></label></p> 
    327330        <h2>Blog Details</h2> 
    328331        <table width='100%'>  
     
    347350    global $wpdb, $current_site; 
    348351    $base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) ); 
    349     if( $base != "/") 
    350     { 
     352    if( $base != "/") { 
    351353           $base .= "/"; 
    352354    }  
     
    367369    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'fileupload_maxk', '1500' )" ); 
    368370    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'site_admins', '" . serialize( array( 'admin' ) ) . "' )" ); 
    369  
     371    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'illegal_names', '" . serialize( array(  "www", "web", "root", "admin", "main", "invite", "administrator" ) ) . "' )" ); 
    370372    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'welcome_email', 'Dear User, 
    371373 
  • trunk/wp-inst/wp-includes/wpmu-functions.php

    r586 r589  
    954954            $errors->add('blog_title', __("Please enter a blog title")); 
    955955 
    956         // Check if the domain has been used already. 
    957         $mydomain = "$blog_id.$domain"; 
    958         if ( domain_exists($mydomain, $base) ) 
     956        // Check if the domain/path has been used already. 
     957        if( constant( "VHOST" ) == 'yes' ) { 
     958                $mydomain = "$blog_id.$domain"; 
     959                $path = $base; 
     960        } else { 
     961                $mydomain = "$domain"; 
     962                $path = $base.$blog_id.'/'; 
     963        } 
     964        if ( domain_exists($mydomain, $path) ) 
    959965                $errors->add('blog_id', __("Sorry, that blog already exists!")); 
    960966 
     
    966972        // Has someone already signed up for this domain? 
    967973        // TODO: Check email too? 
    968         $signup = $wpdb->get_row("SELECT * FROM $wpdb->signups WHERE domain = '$mydomain'"); 
     974        $signup = $wpdb->get_row("SELECT * FROM $wpdb->signups WHERE domain = '$mydomain' AND path = '$path'"); 
    969975        if ( ! empty($signup) ) { 
    970976                $registered_at =  mysql2date('U', $signup->registered); 
     
    973979                // If registered more than two days ago, cancel registration and let this signup go through. 
    974980                if ( $diff > 172800 ) { 
    975                         $wpdb->query("DELETE FROM $wpdb->signups WHERE domain = '$mydomain'"); 
     981                        $wpdb->query("DELETE FROM $wpdb->signups WHERE domain = '$mydomain' AND path = '$path'"); 
    976982                } else { 
    977983                        $errors->add('blog_id', __("That blog is currently reserved but may be available in a couple days.")); 
     
    979985        } 
    980986 
    981         $result = array('domain' => $mydomain, 'path' => $base, 'blog_id' => $blog_id, 'blog_title' => $blog_title, 
     987        $result = array('domain' => $mydomain, 'path' => $path, 'blog_id' => $blog_id, 'blog_title' => $blog_title, 
    982988                                'errors' => $errors); 
    983989 
     
    10241030        } 
    10251031        $message_headers = 'From: ' . stripslashes($title) . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>'; 
    1026         $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s"), $activate_url, "http://$domain"); 
     1032        $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s"), $activate_url, "http://$domain.$path"); 
    10271033        // TODO: Don't hard code activation link. 
    1028         $subject = sprintf(__('Activate %s'), $domain); 
     1034        $subject = sprintf(__('Activate %s'), $domain.$path); 
    10291035        wp_mail($user_email, $subject, $message, $message_headers); 
    10301036} 
     
    11601166function insert_blog($domain, $path, $site_id) { 
    11611167        global $wpdb; 
     1168        $path = trailingslashit( $path ); 
    11621169        $query = "INSERT INTO $wpdb->blogs ( blog_id, site_id, domain, path, registered ) VALUES ( NULL, '$site_id', '$domain', '$path', NOW( ))"; 
    11631170        $result = $wpdb->query( $query ); 
  • trunk/wp-inst/wp-signup.php

    r586 r589  
    4343        } 
    4444        if( constant( "VHOST" ) == 'no' ) { 
    45                 print '<span style="font-size: 20px">' . get_real_siteurl( $current_site->domain, $current_site->path ) . '</span><input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: left; font-size: 20px;" /><br />'; 
     45                print '<span style="font-size: 20px">' . $current_site->domain . $current_site->path . '</span><input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: left; font-size: 20px;" /><br />'; 
    4646        } else { 
    47                 print '<input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: right; font-size: 20px;" /><span style="font-size: 20px">' . get_real_siteurl( $current_site->domain, $current_site->path ) . '</span><br />'; 
     47                print '<input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: right; font-size: 20px;" /><span style="font-size: 20px">' . $current_site->domain . $current_site->path . '</span><br />'; 
    4848        } 
    4949        if ( !is_user_logged_in() ) { 
     
    151151 
    152152        if ( ! empty($blogs) ) foreach ( $blogs as $blog ) { 
    153                 $display = str_replace(".$domain", '', $blog->domain); 
    154                 echo "<li><a href='" . get_real_siteurl( $blog->domain, $blog->path ) . "'>$display</a></li>"; 
     153                echo "<li><a href='" . $blog->domain . $blog->path . "'>" . $blog->domain . $blog->path . "</a></li>"; 
    155154        } 
    156155?> 
     
    191190 
    192191function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta) { 
    193         $url = get_real_siteurl( $domain, $path ); 
    194 ?> 
    195 <h2><?php printf(__('%s Is Yours'), $url ) ?></h2> 
    196 <p><?php printf(__('<a href="%1$s">%2$s</a> is your new blog.  <a href="%3$s">Login</a> as "%4$s" using your existing password.'), $url, $url, $url . "wp-login.php", $user_name) ?></p> 
     192?> 
     193<h2><?php printf(__('%s Is Yours'), $domain.$path ) ?></h2> 
     194<p><?php printf(__('<a href="http://%1$s">http://%2$s</a> is your new blog.  <a href="%3$s">Login</a> as "%4$s" using your existing password.'), $domain.$path, $domain.$path, $domain.$path . "wp-login.php", $user_name) ?></p> 
    197195<?php 
    198196        do_action('signup_finished'); 
     
    218216<br /> 
    219217<input id="signupuser" type="radio" name="signup_for" value="user" /> 
    220 <label for="signupuser">Just an username, please.</label> 
     218<label for="signupuser">Just a username, please.</label> 
    221219</p> 
    222220</td> 
     
    310308function confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta) { 
    311309?> 
    312 <h2><?php printf(__('%s Is Yours'), $domain) ?></h2> 
     310<h2><?php printf(__('%s Is Yours'), $domain.$path) ?></h2> 
    313311<p><?php _e('But, before you can start using your blog, <strong>you must activate it</strong>.') ?></p> 
    314312<p><?php printf(__('Check your inbox at <strong>%1$s</strong> and click the link given.  '),  $user_email) ?></p>