Changeset 589
- Timestamp:
- 06/22/06 12:30:48 (2 years ago)
- Files:
-
- trunk/index.php (modified) (5 diffs)
- trunk/wp-inst/wp-includes/wpmu-functions.php (modified) (6 diffs)
- trunk/wp-inst/wp-signup.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/index.php
r584 r589 265 265 $prefix = 'wp_'; 266 266 $base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) ); 267 if( $base != "/") { 268 $base .= "/"; 269 } 267 270 268 271 // Test the db connection. … … 298 301 fwrite($handle, str_replace("localhost", $dbhost, $line)); 299 302 break; 300 case "define('VHOST', ":303 case "define('VHOST',": 301 304 fwrite($handle, str_replace("VHOSTSETTING", $vhost, $line)); 302 305 break; … … 322 325 <form method='post' action='index.php'> 323 326 <input type='hidden' name='action' value='step3'> 324 <p>To finish setting up your blog, please fill in the foll ing 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> 325 328 <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> 327 330 <h2>Blog Details</h2> 328 331 <table width='100%'> … … 347 350 global $wpdb, $current_site; 348 351 $base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) ); 349 if( $base != "/") 350 { 352 if( $base != "/") { 351 353 $base .= "/"; 352 354 } … … 367 369 $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'fileupload_maxk', '1500' )" ); 368 370 $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" ) ) . "' )" ); 370 372 $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'welcome_email', 'Dear User, 371 373 trunk/wp-inst/wp-includes/wpmu-functions.php
r586 r589 954 954 $errors->add('blog_title', __("Please enter a blog title")); 955 955 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) ) 959 965 $errors->add('blog_id', __("Sorry, that blog already exists!")); 960 966 … … 966 972 // Has someone already signed up for this domain? 967 973 // 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'"); 969 975 if ( ! empty($signup) ) { 970 976 $registered_at = mysql2date('U', $signup->registered); … … 973 979 // If registered more than two days ago, cancel registration and let this signup go through. 974 980 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'"); 976 982 } else { 977 983 $errors->add('blog_id', __("That blog is currently reserved but may be available in a couple days.")); … … 979 985 } 980 986 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, 982 988 'errors' => $errors); 983 989 … … 1024 1030 } 1025 1031 $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"); 1027 1033 // TODO: Don't hard code activation link. 1028 $subject = sprintf(__('Activate %s'), $domain );1034 $subject = sprintf(__('Activate %s'), $domain.$path); 1029 1035 wp_mail($user_email, $subject, $message, $message_headers); 1030 1036 } … … 1160 1166 function insert_blog($domain, $path, $site_id) { 1161 1167 global $wpdb; 1168 $path = trailingslashit( $path ); 1162 1169 $query = "INSERT INTO $wpdb->blogs ( blog_id, site_id, domain, path, registered ) VALUES ( NULL, '$site_id', '$domain', '$path', NOW( ))"; 1163 1170 $result = $wpdb->query( $query ); trunk/wp-inst/wp-signup.php
r586 r589 43 43 } 44 44 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 />'; 46 46 } 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 />'; 48 48 } 49 49 if ( !is_user_logged_in() ) { … … 151 151 152 152 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>"; 155 154 } 156 155 ?> … … 191 190 192 191 function 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> 197 195 <?php 198 196 do_action('signup_finished'); … … 218 216 <br /> 219 217 <input id="signupuser" type="radio" name="signup_for" value="user" /> 220 <label for="signupuser">Just a nusername, please.</label>218 <label for="signupuser">Just a username, please.</label> 221 219 </p> 222 220 </td> … … 310 308 function confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta) { 311 309 ?> 312 <h2><?php printf(__('%s Is Yours'), $domain ) ?></h2>310 <h2><?php printf(__('%s Is Yours'), $domain.$path) ?></h2> 313 311 <p><?php _e('But, before you can start using your blog, <strong>you must activate it</strong>.') ?></p> 314 312 <p><?php printf(__('Check your inbox at <strong>%1$s</strong> and click the link given. '), $user_email) ?></p>
