Changeset 12735 for trunk/wp-signup.php
- Timestamp:
- 01/15/2010 11:40:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-signup.php
r12733 r12735 9 9 require_once( ABSPATH . WPINC . '/registration.php' ); 10 10 11 if ( is_array( get_site_option( 'illegal_names' )) && $_GET[ 'new' ] != '' && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) {11 if ( is_array( get_site_option( 'illegal_names' )) && $_GET[ 'new' ] != '' && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) { 12 12 wp_redirect( "http://{$current_site->domain}{$current_site->path}" ); 13 13 die(); … … 23 23 } 24 24 25 if ( $current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path ) {25 if ( $current_blog->domain . $current_blog->path != $current_site->domain . $current_site->path ) { 26 26 wp_redirect( "http://" . $current_site->domain . $current_site->path . "wp-signup.php" ); 27 27 die(); … … 57 57 global $current_site; 58 58 // Blog name 59 if ( !is_subdomain_install() )59 if ( !is_subdomain_install() ) 60 60 echo '<label for="blogname">' . __('Blog Name:') . '</label>'; 61 61 else … … 66 66 <?php } 67 67 68 if ( !is_subdomain_install() ) {68 if ( !is_subdomain_install() ) 69 69 echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="50" /><br />'; 70 } else {70 else 71 71 echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . $current_site->path . '</span><br />'; 72 } 72 73 73 if ( !is_user_logged_in() ) { 74 74 print '(<strong>' . __( 'Your address will be ' ); 75 if ( !is_subdomain_install() ) {75 if ( !is_subdomain_install() ) 76 76 print $current_site->domain . $current_site->path . __( 'blogname' ); 77 } else {77 else 78 78 print __( 'domain.' ) . $current_site->domain . $current_site->path; 79 }80 79 echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' ) . '</p>'; 81 80 } … … 96 95 <div style="clear:both;"></div> 97 96 <label class="checkbox" for="blog_public_on"> 98 <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />97 <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> /> 99 98 <strong><?php _e( 'Yes' ); ?></strong> 100 99 </label> 101 100 <label class="checkbox" for="blog_public_off"> 102 <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />101 <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> /> 103 102 <strong><?php _e( 'No' ); ?></strong> 104 103 </label> … … 191 190 global $wpdb, $current_user, $blogname, $blog_title, $errors, $domain, $path; 192 191 $current_user = wp_get_current_user(); 193 if ( !is_user_logged_in() )192 if ( !is_user_logged_in() ) 194 193 die(); 195 194 … … 226 225 if ( !is_wp_error($errors) ) 227 226 $errors = new WP_Error(); 228 if ( isset( $_POST[ 'signup_for' ] ) ) {227 if ( isset( $_POST[ 'signup_for' ] ) ) 229 228 $signup[ wp_specialchars( $_POST[ 'signup_for' ] ) ] = 'checked="checked"'; 230 } else {229 else 231 230 $signup[ 'blog' ] = 'checked="checked"'; 232 }233 231 234 232 // allow definition of default variables … … 247 245 248 246 <p> 249 <?php if ( $active_signup == 'blog' ) { ?>247 <?php if ( $active_signup == 'blog' ) { ?> 250 248 <input id="signupblog" type="hidden" name="signup_for" value="blog" /> 251 <?php } elseif ( $active_signup == 'user' ) { ?>249 <?php } elseif ( $active_signup == 'user' ) { ?> 252 250 <input id="signupblog" type="hidden" name="signup_for" value="user" /> 253 251 <?php } else { ?> … … 370 368 // Main 371 369 $active_signup = get_site_option( 'registration' ); 372 if ( !$active_signup )370 if ( !$active_signup ) 373 371 $active_signup = 'all'; 374 372 375 373 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 376 374 377 if ( is_super_admin() )375 if ( is_super_admin() ) 378 376 echo '<div class="mu_alert">' . sprintf( __( "Greetings Site Administrator! You are currently allowing '%s' registrations. To change or disable registration go to your <a href='wp-admin/ms-options.php'>Options page</a>." ), $active_signup ) . '</div>'; 379 377 … … 381 379 382 380 $current_user = wp_get_current_user(); 383 if ( $active_signup == "none" ) {381 if ( $active_signup == "none" ) { 384 382 _e( "Registration has been disabled." ); 385 } elseif ( $active_signup == 'blog' && !is_user_logged_in() ){386 if ( is_ssl() ) {383 } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { 384 if ( is_ssl() ) 387 385 $proto = 'https://'; 388 } else {386 else 389 387 $proto = 'http://'; 390 }391 388 $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' )); 392 389 echo sprintf( __( "You must first <a href=\"%s\">login</a>, and then you can create a new blog."), $login_url ); … … 400 397 break; 401 398 case 'validate-blog-signup': 402 if ( $active_signup == 'all' || $active_signup == 'blog' )399 if ( $active_signup == 'all' || $active_signup == 'blog' ) 403 400 validate_blog_signup(); 404 401 else … … 411 408 $user_email = $_POST[ 'user_email' ]; 412 409 do_action( "preprocess_signup_form" ); // populate the form from invites, elsewhere? 413 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) {410 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) 414 411 signup_another_blog($newblogname); 415 } elseif( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) {412 elseif( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) 416 413 signup_user( $newblogname, $user_email ); 417 } elseif( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) {414 elseif( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) 418 415 _e( "I'm sorry. We're not accepting new registrations at this time." ); 419 } else {416 else 420 417 _e( "You're logged in already. No need to register again!" ); 421 } 418 422 419 if ($newblogname) { 423 if ( !is_subdomain_install() )420 if ( !is_subdomain_install() ) 424 421 $newblog = 'http://' . $current_site->domain . $current_site->path . $newblogname . '/'; 425 422 else 426 423 $newblog = 'http://' . $newblogname . '.' . $current_site->domain . $current_site->path; 427 if ( $active_signup == 'blog' || $active_signup == 'all')424 if ( $active_signup == 'blog' || $active_signup == 'all' ) 428 425 printf(__("<p><em>The blog you were looking for, <strong>%s</strong> doesn't exist but you can create it now!</em></p>"), $newblog ); 429 426 else
Note: See TracChangeset
for help on using the changeset viewer.