Changeset 42343 for trunk/src/wp-signup.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-signup.php
r42217 r42343 2 2 3 3 /** Sets up the WordPress Environment. */ 4 require( dirname( __FILE__) . '/wp-load.php' );4 require( dirname( __FILE__ ) . '/wp-load.php' ); 5 5 6 6 add_action( 'wp_head', 'wp_no_robots' ); … … 8 8 require( dirname( __FILE__ ) . '/wp-blog-header.php' ); 9 9 10 if ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new'], get_site_option( 'illegal_names' ) ) ) {10 if ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET['new'] ) && in_array( $_GET['new'], get_site_option( 'illegal_names' ) ) ) { 11 11 wp_redirect( network_home_url() ); 12 12 die(); … … 28 28 add_action( 'wp_head', 'do_signup_header' ); 29 29 30 if ( ! is_multisite() ) {30 if ( ! is_multisite() ) { 31 31 wp_redirect( wp_registration_url() ); 32 32 die(); 33 33 } 34 34 35 if ( ! is_main_site() ) {35 if ( ! is_main_site() ) { 36 36 wp_redirect( network_site_url( 'wp-signup.php' ) ); 37 37 die(); … … 103 103 $current_network = get_network(); 104 104 // Blog name 105 if ( !is_subdomain_install() ) 106 echo '<label for="blogname">' . __('Site Name:') . '</label>'; 107 else 108 echo '<label for="blogname">' . __('Site Domain:') . '</label>'; 109 110 if ( $errmsg = $errors->get_error_message('blogname') ) { ?> 111 <p class="error"><?php echo $errmsg ?></p> 112 <?php } 113 114 if ( !is_subdomain_install() ) 115 echo '<span class="prefix_address">' . $current_network->domain . $current_network->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="60" /><br />'; 116 else 117 echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="60" /><span class="suffix_address">.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_network->domain ) ) . '</span><br />'; 105 if ( ! is_subdomain_install() ) { 106 echo '<label for="blogname">' . __( 'Site Name:' ) . '</label>'; 107 } else { 108 echo '<label for="blogname">' . __( 'Site Domain:' ) . '</label>'; 109 } 110 111 if ( $errmsg = $errors->get_error_message( 'blogname' ) ) { 112 ?> 113 <p class="error"><?php echo $errmsg; ?></p> 114 <?php 115 } 116 117 if ( ! is_subdomain_install() ) { 118 echo '<span class="prefix_address">' . $current_network->domain . $current_network->path . '</span><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" /><br />'; 119 } else { 120 echo '<input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" /><span class="suffix_address">.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_network->domain ) ) . '</span><br />'; 121 } 118 122 119 123 if ( ! is_user_logged_in() ) { … … 130 134 // Blog Title 131 135 ?> 132 <label for="blog_title"><?php _e('Site Title:') ?></label> 133 <?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?> 134 <p class="error"><?php echo $errmsg ?></p> 135 <?php } 136 echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_attr($blog_title).'" />'; 136 <label for="blog_title"><?php _e( 'Site Title:' ); ?></label> 137 <?php if ( $errmsg = $errors->get_error_message( 'blog_title' ) ) { ?> 138 <p class="error"><?php echo $errmsg; ?></p> 139 <?php 140 } 141 echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_attr( $blog_title ) . '" />'; 137 142 ?> 138 143 … … 158 163 } 159 164 160 wp_dropdown_languages( array( 161 'name' => 'WPLANG', 162 'id' => 'site-language', 163 'selected' => $lang, 164 'languages' => $languages, 165 'show_available_translations' => false, 166 ) ); 165 wp_dropdown_languages( 166 array( 167 'name' => 'WPLANG', 168 'id' => 'site-language', 169 'selected' => $lang, 170 'languages' => $languages, 171 'show_available_translations' => false, 172 ) 173 ); 167 174 ?> 168 175 </p> … … 171 178 172 179 $blog_public_on_checked = $blog_public_off_checked = ''; 173 if ( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public']) {174 175 176 177 180 if ( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { 181 $blog_public_off_checked = 'checked="checked"'; 182 } else { 183 $blog_public_on_checked = 'checked="checked"'; 184 } 178 185 ?> 179 186 180 187 <div id="privacy"> 181 182 <label for="blog_public_on"><?php _e('Privacy:')?></label>183 184 185 186 187 188 189 190 191 192 193 188 <p class="privacy-intro"> 189 <label for="blog_public_on"><?php _e( 'Privacy:' ); ?></label> 190 <?php _e( 'Allow search engines to index this site.' ); ?> 191 <br style="clear:both" /> 192 <label class="checkbox" for="blog_public_on"> 193 <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php echo $blog_public_on_checked; ?> /> 194 <strong><?php _e( 'Yes' ); ?></strong> 195 </label> 196 <label class="checkbox" for="blog_public_off"> 197 <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php echo $blog_public_off_checked; ?> /> 198 <strong><?php _e( 'No' ); ?></strong> 199 </label> 200 </p> 194 201 </div> 195 202 … … 214 221 function validate_blog_form() { 215 222 $user = ''; 216 if ( is_user_logged_in() ) 223 if ( is_user_logged_in() ) { 217 224 $user = wp_get_current_user(); 218 219 return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user); 225 } 226 227 return wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'], $user ); 220 228 } 221 229 … … 229 237 * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. 230 238 */ 231 function show_user_form( $user_name = '', $user_email = '', $errors = '') {239 function show_user_form( $user_name = '', $user_email = '', $errors = '' ) { 232 240 if ( ! is_wp_error( $errors ) ) { 233 241 $errors = new WP_Error(); … … 235 243 236 244 // User name 237 echo '<label for="user_name">' . __( 'Username:') . '</label>';238 if ( $errmsg = $errors->get_error_message( 'user_name') ) {239 echo '<p class="error">' .$errmsg.'</p>';240 } 241 echo '<input name="user_name" type="text" id="user_name" value="' . esc_attr( $user_name ) .'" autocapitalize="none" autocorrect="off" maxlength="60" /><br />';245 echo '<label for="user_name">' . __( 'Username:' ) . '</label>'; 246 if ( $errmsg = $errors->get_error_message( 'user_name' ) ) { 247 echo '<p class="error">' . $errmsg . '</p>'; 248 } 249 echo '<input name="user_name" type="text" id="user_name" value="' . esc_attr( $user_name ) . '" autocapitalize="none" autocorrect="off" maxlength="60" /><br />'; 242 250 _e( '(Must be at least 4 characters, letters and numbers only.)' ); 243 251 ?> 244 252 245 <label for="user_email"><?php _e( 'Email Address:' ) ?></label>246 <?php if ( $errmsg = $errors->get_error_message( 'user_email') ) { ?>247 <p class="error"><?php echo $errmsg ?></p>253 <label for="user_email"><?php _e( 'Email Address:' ); ?></label> 254 <?php if ( $errmsg = $errors->get_error_message( 'user_email' ) ) { ?> 255 <p class="error"><?php echo $errmsg; ?></p> 248 256 <?php } ?> 249 <input name="user_email" type="email" id="user_email" value="<?php echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('We send your registration email to this address. (Double-check your email address before continuing.)')?>250 <?php 251 if ( $errmsg = $errors->get_error_message( 'generic') ) {257 <input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" /><br /><?php _e( 'We send your registration email to this address. (Double-check your email address before continuing.)' ); ?> 258 <?php 259 if ( $errmsg = $errors->get_error_message( 'generic' ) ) { 252 260 echo '<p class="error">' . $errmsg . '</p>'; 253 261 } … … 270 278 */ 271 279 function validate_user_form() { 272 return wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email']);280 return wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] ); 273 281 } 274 282 … … 285 293 $current_user = wp_get_current_user(); 286 294 287 if ( ! is_wp_error( $errors) ) {295 if ( ! is_wp_error( $errors ) ) { 288 296 $errors = new WP_Error(); 289 297 } … … 292 300 'blogname' => $blogname, 293 301 'blog_title' => $blog_title, 294 'errors' => $errors 302 'errors' => $errors, 295 303 ); 296 304 … … 310 318 $filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults ); 311 319 312 $blogname = $filtered_results['blogname'];320 $blogname = $filtered_results['blogname']; 313 321 $blog_title = $filtered_results['blog_title']; 314 $errors = $filtered_results['errors'];322 $errors = $filtered_results['errors']; 315 323 316 324 echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), get_network()->site_name ) . '</h2>'; … … 320 328 } 321 329 ?> 322 <p><?php printf( __( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart’s content, but write responsibly!' ), $current_user->display_name ) ?></p> 323 324 <?php 325 $blogs = get_blogs_of_user($current_user->ID); 326 if ( !empty($blogs) ) { ?> 327 328 <p><?php _e( 'Sites you are already a member of:' ) ?></p> 330 <p><?php printf( __( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart’s content, but write responsibly!' ), $current_user->display_name ); ?></p> 331 332 <?php 333 $blogs = get_blogs_of_user( $current_user->ID ); 334 if ( ! empty( $blogs ) ) { 335 ?> 336 337 <p><?php _e( 'Sites you are already a member of:' ); ?></p> 329 338 <ul> 330 <?php foreach ( $blogs as $blog ) { 339 <?php 340 foreach ( $blogs as $blog ) { 331 341 $home_url = get_home_url( $blog->userblog_id ); 332 342 echo '<li><a href="' . esc_url( $home_url ) . '">' . $home_url . '</a></li>'; 333 } ?> 343 } 344 ?> 334 345 </ul> 335 346 <?php } ?> 336 347 337 <p><?php _e( 'If you’re not going to use a great site domain, leave it for a new user. Now have at it!' ) ?></p>348 <p><?php _e( 'If you’re not going to use a great site domain, leave it for a new user. Now have at it!' ); ?></p> 338 349 <form id="setupform" method="post" action="wp-signup.php"> 339 350 <input type="hidden" name="stage" value="gimmeanotherblog" /> … … 349 360 do_action( 'signup_hidden_fields', 'create-another-site' ); 350 361 ?> 351 <?php show_blog_form( $blogname, $blog_title, $errors); ?>352 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ) ?>" /></p>362 <?php show_blog_form( $blogname, $blog_title, $errors ); ?> 363 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ); ?>" /></p> 353 364 </form> 354 365 <?php … … 373 384 374 385 // Extracted values set/overwrite globals. 375 $domain = $result['domain'];376 $path = $result['path'];377 $blogname = $result['blogname'];386 $domain = $result['domain']; 387 $path = $result['path']; 388 $blogname = $result['blogname']; 378 389 $blog_title = $result['blog_title']; 379 $errors = $result['errors'];390 $errors = $result['errors']; 380 391 381 392 if ( $errors->get_error_code() ) { 382 signup_another_blog( $blogname, $blog_title, $errors);393 signup_another_blog( $blogname, $blog_title, $errors ); 383 394 return false; 384 395 } … … 388 399 $blog_meta_defaults = array( 389 400 'lang_id' => 1, 390 'public' => $public 401 'public' => $public, 391 402 ); 392 403 … … 403 414 } 404 415 } 405 406 416 } 407 417 … … 468 478 } 469 479 470 $site = sprintf( '<a href="%1$s">%2$s</a>', 480 $site = sprintf( 481 '<a href="%1$s">%2$s</a>', 471 482 esc_url( $home_url ), 472 483 $blog_title … … 474 485 475 486 ?> 476 <h2><?php 487 <h2> 488 <?php 477 489 /* translators: %s: site name */ 478 490 printf( __( 'The site %s is yours.' ), $site ); 479 ?></h2> 491 ?> 492 </h2> 480 493 <p> 481 <?php printf( 494 <?php 495 printf( 482 496 /* translators: 1: link to new site, 2: login URL, 3: username */ 483 497 __( '%1$s is your new site. <a href="%2$s">Log in</a> as “%3$s” using your existing password.' ), … … 489 503 esc_url( $login_url ), 490 504 $user_name 491 ); ?> 505 ); 506 ?> 492 507 </p> 493 508 <?php … … 512 527 global $active_signup; 513 528 514 if ( ! is_wp_error($errors) )529 if ( ! is_wp_error( $errors ) ) { 515 530 $errors = new WP_Error(); 516 517 $signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog'; 531 } 532 533 $signup_for = isset( $_POST['signup_for'] ) ? esc_html( $_POST['signup_for'] ) : 'blog'; 518 534 519 535 $signup_user_defaults = array( … … 537 553 */ 538 554 $filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults ); 539 $user_name = $filtered_results['user_name']; 540 $user_email = $filtered_results['user_email']; 541 $errors = $filtered_results['errors']; 542 543 ?> 544 545 <h2><?php 555 $user_name = $filtered_results['user_name']; 556 $user_email = $filtered_results['user_email']; 557 $errors = $filtered_results['errors']; 558 559 ?> 560 561 <h2> 562 <?php 546 563 /* translators: %s: name of the network */ 547 564 printf( __( 'Get your own %s account in seconds' ), get_network()->site_name ); 548 ?></h2> 565 ?> 566 </h2> 549 567 <form id="setupform" method="post" action="wp-signup.php" novalidate="novalidate"> 550 568 <input type="hidden" name="stage" value="validate-user-signup" /> … … 553 571 do_action( 'signup_hidden_fields', 'validate-user' ); 554 572 ?> 555 <?php show_user_form( $user_name, $user_email, $errors); ?>573 <?php show_user_form( $user_name, $user_email, $errors ); ?> 556 574 557 575 <p> … … 562 580 <?php } else { ?> 563 581 <input id="signupblog" type="radio" name="signup_for" value="blog" <?php checked( $signup_for, 'blog' ); ?> /> 564 <label class="checkbox" for="signupblog"><?php _e( 'Gimme a site!')?></label>582 <label class="checkbox" for="signupblog"><?php _e( 'Gimme a site!' ); ?></label> 565 583 <br /> 566 584 <input id="signupuser" type="radio" name="signup_for" value="user" <?php checked( $signup_for, 'user' ); ?> /> 567 <label class="checkbox" for="signupuser"><?php _e( 'Just a username, please.')?></label>585 <label class="checkbox" for="signupuser"><?php _e( 'Just a username, please.' ); ?></label> 568 586 <?php } ?> 569 587 </p> 570 588 571 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Next')?>" /></p>589 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Next' ); ?>" /></p> 572 590 </form> 573 591 <?php … … 582 600 */ 583 601 function validate_user_signup() { 584 $result = validate_user_form();585 $user_name = $result['user_name'];602 $result = validate_user_form(); 603 $user_name = $result['user_name']; 586 604 $user_email = $result['user_email']; 587 $errors = $result['errors'];605 $errors = $result['errors']; 588 606 589 607 if ( $errors->get_error_code() ) { 590 signup_user( $user_name, $user_email, $errors);608 signup_user( $user_name, $user_email, $errors ); 591 609 return false; 592 610 } 593 611 594 612 if ( 'blog' == $_POST['signup_for'] ) { 595 signup_blog( $user_name, $user_email);613 signup_blog( $user_name, $user_email ); 596 614 return false; 597 615 } … … 600 618 wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) ); 601 619 602 confirm_user_signup( $user_name, $user_email);620 confirm_user_signup( $user_name, $user_email ); 603 621 return true; 604 622 } … … 612 630 * @param string $user_email The user's email address 613 631 */ 614 function confirm_user_signup($user_name, $user_email) { 615 ?> 616 <h2><?php /* translators: %s: username */ 617 printf( __( '%s is your new username' ), $user_name) ?></h2> 618 <p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ) ?></p> 619 <p><?php /* translators: %s: email address */ 620 printf( __( 'Check your inbox at %s and click the link given.' ), '<strong>' . $user_email . '</strong>' ); ?></p> 632 function confirm_user_signup( $user_name, $user_email ) { 633 ?> 634 <h2> 635 <?php 636 /* translators: %s: username */ 637 printf( __( '%s is your new username' ), $user_name ) 638 ?> 639 </h2> 640 <p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ); ?></p> 641 <p> 642 <?php 643 /* translators: %s: email address */ 644 printf( __( 'Check your inbox at %s and click the link given.' ), '<strong>' . $user_email . '</strong>' ); 645 ?> 646 </p> 621 647 <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p> 622 648 <?php … … 636 662 * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. 637 663 */ 638 function signup_blog( $user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {639 if ( ! is_wp_error($errors) )664 function signup_blog( $user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '' ) { 665 if ( ! is_wp_error( $errors ) ) { 640 666 $errors = new WP_Error(); 667 } 641 668 642 669 $signup_blog_defaults = array( … … 645 672 'blogname' => $blogname, 646 673 'blog_title' => $blog_title, 647 'errors' => $errors 674 'errors' => $errors, 648 675 ); 649 676 … … 665 692 $filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults ); 666 693 667 $user_name = $filtered_results['user_name'];694 $user_name = $filtered_results['user_name']; 668 695 $user_email = $filtered_results['user_email']; 669 $blogname = $filtered_results['blogname'];696 $blogname = $filtered_results['blogname']; 670 697 $blog_title = $filtered_results['blog_title']; 671 $errors = $filtered_results['errors'];672 673 if ( empty( $blogname) )698 $errors = $filtered_results['errors']; 699 700 if ( empty( $blogname ) ) { 674 701 $blogname = $user_name; 702 } 675 703 ?> 676 704 <form id="setupform" method="post" action="wp-signup.php"> 677 705 <input type="hidden" name="stage" value="validate-blog-signup" /> 678 <input type="hidden" name="user_name" value="<?php echo esc_attr( $user_name)?>" />679 <input type="hidden" name="user_email" value="<?php echo esc_attr( $user_email)?>" />706 <input type="hidden" name="user_name" value="<?php echo esc_attr( $user_name ); ?>" /> 707 <input type="hidden" name="user_email" value="<?php echo esc_attr( $user_email ); ?>" /> 680 708 <?php 681 709 /** This action is documented in wp-signup.php */ 682 710 do_action( 'signup_hidden_fields', 'validate-site' ); 683 711 ?> 684 <?php show_blog_form( $blogname, $blog_title, $errors); ?>685 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Signup')?>" /></p>712 <?php show_blog_form( $blogname, $blog_title, $errors ); ?> 713 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Signup' ); ?>" /></p> 686 714 </form> 687 715 <?php … … 698 726 // Re-validate user info. 699 727 $user_result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] ); 700 $user_name = $user_result['user_name'];701 $user_email = $user_result['user_email'];728 $user_name = $user_result['user_name']; 729 $user_email = $user_result['user_email']; 702 730 $user_errors = $user_result['errors']; 703 731 … … 707 735 } 708 736 709 $result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] );710 $domain = $result['domain'];711 $path = $result['path'];712 $blogname = $result['blogname'];737 $result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] ); 738 $domain = $result['domain']; 739 $path = $result['path']; 740 $blogname = $result['blogname']; 713 741 $blog_title = $result['blog_title']; 714 $errors = $result['errors'];742 $errors = $result['errors']; 715 743 716 744 if ( $errors->get_error_code() ) { 717 signup_blog( $user_name, $user_email, $blogname, $blog_title, $errors);745 signup_blog( $user_name, $user_email, $blogname, $blog_title, $errors ); 718 746 return false; 719 747 } 720 748 721 $public = (int) $_POST['blog_public']; 722 $signup_meta = array ('lang_id' => 1, 'public' => $public); 749 $public = (int) $_POST['blog_public']; 750 $signup_meta = array( 751 'lang_id' => 1, 752 'public' => $public, 753 ); 723 754 724 755 // Handle the language setting for the new site. … … 734 765 } 735 766 } 736 737 767 } 738 768 … … 740 770 $meta = apply_filters( 'add_signup_meta', $signup_meta ); 741 771 742 wpmu_signup_blog( $domain, $path, $blog_title, $user_name, $user_email, $meta);743 confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email, $meta);772 wpmu_signup_blog( $domain, $path, $blog_title, $user_name, $user_email, $meta ); 773 confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email, $meta ); 744 774 return true; 745 775 } … … 759 789 function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) { 760 790 ?> 761 <h2><?php /* translators: %s: site address */ 762 printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2> 763 764 <p><?php _e( 'But, before you can start using your site, <strong>you must activate it</strong>.' ) ?></p> 765 <p><?php /* translators: %s: email address */ 766 printf( __( 'Check your inbox at %s and click the link given.' ), '<strong>' . $user_email . '</strong>' ); ?></p> 791 <h2> 792 <?php 793 /* translators: %s: site address */ 794 printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) 795 ?> 796 </h2> 797 798 <p><?php _e( 'But, before you can start using your site, <strong>you must activate it</strong>.' ); ?></p> 799 <p> 800 <?php 801 /* translators: %s: email address */ 802 printf( __( 'Check your inbox at %s and click the link given.' ), '<strong>' . $user_email . '</strong>' ); 803 ?> 804 </p> 767 805 <p><?php _e( 'If you do not activate your site within two days, you will have to sign up again.' ); ?></p> 768 806 <h2><?php _e( 'Still waiting for your email?' ); ?></h2> 769 807 <p> 770 <?php _e( 'If you haven’t received your email yet, there are a number of things you can do:' ) ?>808 <?php _e( 'If you haven’t received your email yet, there are a number of things you can do:' ); ?> 771 809 <ul id="noemail-tips"> 772 <li><p><strong><?php _e( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ) ?></strong></p></li> 773 <li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ) ?></p></li> 774 <li><?php 810 <li><p><strong><?php _e( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ); ?></strong></p></li> 811 <li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ); ?></p></li> 812 <li> 813 <?php 775 814 /* translators: %s: email address */ 776 815 printf( __( 'Have you entered your email correctly? You have entered %s, if it’s incorrect, you will not receive your email.' ), $user_email ); 777 ?></li> 816 ?> 817 </li> 778 818 </ul> 779 819 </p> … … 856 896 } 857 897 858 $newblogname = isset( $_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null;898 $newblogname = isset( $_GET['new'] ) ? strtolower( preg_replace( '/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'] ) ) : null; 859 899 860 900 $current_user = wp_get_current_user(); 861 901 if ( $active_signup == 'none' ) { 862 902 _e( 'Registration has been disabled.' ); 863 } elseif ( $active_signup == 'blog' && ! is_user_logged_in() ) {903 } elseif ( $active_signup == 'blog' && ! is_user_logged_in() ) { 864 904 $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); 865 905 /* translators: %s: login URL */ 866 906 printf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url ); 867 907 } else { 868 $stage = isset( $_POST['stage'] ) ? 908 $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; 869 909 switch ( $stage ) { 870 case 'validate-user-signup' 871 if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' )910 case 'validate-user-signup': 911 if ( $active_signup == 'all' || $_POST['signup_for'] == 'blog' && $active_signup == 'blog' || $_POST['signup_for'] == 'user' && $active_signup == 'user' ) { 872 912 validate_user_signup(); 873 else913 } else { 874 914 _e( 'User registration has been disabled.' ); 875 break; 915 } 916 break; 876 917 case 'validate-blog-signup': 877 if ( $active_signup == 'all' || $active_signup == 'blog' ) 918 if ( $active_signup == 'all' || $active_signup == 'blog' ) { 878 919 validate_blog_signup(); 879 else920 } else { 880 921 _e( 'Site registration has been disabled.' ); 922 } 881 923 break; 882 924 case 'gimmeanotherblog': … … 884 926 break; 885 927 case 'default': 886 default 887 $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email'] : '';928 default: 929 $user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : ''; 888 930 /** 889 931 * Fires when the site sign-up form is sent. … … 892 934 */ 893 935 do_action( 'preprocess_signup_form' ); 894 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) 895 signup_another_blog( $newblogname);896 elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) )936 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) { 937 signup_another_blog( $newblogname ); 938 } elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) ) { 897 939 signup_user( $newblogname, $user_email ); 898 elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) )940 } elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) ) { 899 941 _e( 'Sorry, new registrations are not allowed at this time.' ); 900 else942 } else { 901 943 _e( 'You are logged in already. No need to register again!' ); 944 } 902 945 903 946 if ( $newblogname ) { 904 947 $newblog = get_blogaddress_by_name( $newblogname ); 905 948 906 if ( $active_signup == 'blog' || $active_signup == 'all' ) 949 if ( $active_signup == 'blog' || $active_signup == 'all' ) { 907 950 /* translators: %s: site address */ 908 printf( '<p><em>' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '</em></p>', 951 printf( 952 '<p><em>' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '</em></p>', 909 953 '<strong>' . $newblog . '</strong>' 910 954 ); 911 else912 /* translators: %s: site address */913 printf('<p><em>' . __( 'The site you were looking for, %s, does not exist.' ) . '</em></p>',955 } else { /* translators: %s: site address */ 956 printf( 957 '<p><em>' . __( 'The site you were looking for, %s, does not exist.' ) . '</em></p>', 914 958 '<strong>' . $newblog . '</strong>' 915 959 ); 960 } 916 961 } 917 962 break; … … 927 972 * @since 3.0.0 928 973 */ 929 do_action( 'after_signup_form' ); ?> 930 931 <?php get_footer( 'wp-signup' ); 974 do_action( 'after_signup_form' ); 975 ?> 976 977 <?php 978 get_footer( 'wp-signup' );
Note: See TracChangeset
for help on using the changeset viewer.