Changeset 10899
- Timestamp:
- 04/14/2021 03:56:53 AM (4 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
r10893 r10899 80 80 * Handles creating a "Pending" registration that will later be converted to an actual user account. 81 81 */ 82 function wporg_login_create_pending_user( $user_login, $user_email, $user_mailinglist = false ) {82 function wporg_login_create_pending_user( $user_login, $user_email, $user_mailinglist = false, $tos_revision = 0 ) { 83 83 global $wpdb, $wp_hasher; 84 84 … … 97 97 $profile_key = wp_generate_password( 24, false, false ); 98 98 $hashed_profile_key = time() . ':' . wp_hash_password( $profile_key ); 99 100 $tos_meta_key = WPOrg_SSO::TOS_USER_META_KEY; 99 101 100 102 $pending_user = array( … … 107 109 'user_mailinglist' => $user_mailinglist, 108 110 'registration_ip' => $_SERVER['REMOTE_ADDR'], // Spam & fraud control. Will be discarded after the account is created. 111 $tos_meta_key => $tos_revision, 109 112 ), 110 113 'scores' => array() … … 289 292 } 290 293 291 foreach ( array( 'url', 'from', 'occ', 'interests' ) as $field ) { 294 $tos_meta_key = WPOrg_SSO::TOS_USER_META_KEY; 295 296 foreach ( array( 'url', 'from', 'occ', 'interests', $tos_meta_key ) as $field ) { 292 297 if ( !empty( $pending_user['meta'][ $field ] ) ) { 293 298 $value = $pending_user['meta'][ $field ]; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php
r10898 r10899 57 57 */ 58 58 function wporg_login_replace_css() { 59 wp_enqueue_style( 'wporg-login', get_template_directory_uri() . '/stylesheets/login.css', array( 'login', 'dashicons' ), '202 00507' );59 wp_enqueue_style( 'wporg-login', get_template_directory_uri() . '/stylesheets/login.css', array( 'login', 'dashicons' ), '20210414' ); 60 60 } 61 61 add_action( 'login_init', 'wporg_login_replace_css' ); … … 73 73 74 74 wp_enqueue_style( 'wporg-normalize', get_template_directory_uri() . '/stylesheets/normalize.css', 3 ); 75 wp_enqueue_style( 'wporg-login', get_template_directory_uri() . '/stylesheets/login.css', array( 'login', 'dashicons' ), '202 00507' );75 wp_enqueue_style( 'wporg-login', get_template_directory_uri() . '/stylesheets/login.css', array( 'login', 'dashicons' ), '20210414' ); 76 76 } 77 77 add_action( 'wp_enqueue_scripts', 'wporg_login_scripts' ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php
r10898 r10899 6 6 */ 7 7 8 $user_login = isset( $_POST['user_login'] ) ? trim( wp_unslash( $_POST['user_login'] ) ) : ''; 9 if ( ! $user_login && !empty( WP_WPOrg_SSO::$matched_route_params['user'] ) ) { 8 $user_login = isset( $_POST['user_login'] ) ? trim( wp_unslash( $_POST['user_login'] ) ) : ''; 9 $user_email = isset( $_POST['user_email'] ) ? trim( wp_unslash( $_POST['user_email'] ) ) : ''; 10 $user_mailinglist = isset( $_POST['user_mailinglist'] ) && 'true' == $_POST['user_mailinglist']; 11 $terms_of_service = isset( $_POST['terms_of_service'] ) ? $_POST['terms_of_service'] : false; 12 13 if ( ! $user_login && ! empty( WP_WPOrg_SSO::$matched_route_params['user'] ) ) { 10 14 $user_login = trim( WP_WPOrg_SSO::$matched_route_params['user'] ); 11 15 } 12 $user_email = isset( $_POST['user_email'] ) ? trim( wp_unslash( $_POST['user_email'] ) ) : '';13 $user_mailinglist = isset( $_POST['user_mailinglist'] ) && 'true' == $_POST['user_mailinglist'];14 16 15 17 $error_user_login = $error_user_email = $error_recapcha_status = false; … … 26 28 } 27 29 30 // Don't validate that it's equal to the current revision, just that they've agreed to one. 31 // Let the post-login interstitial handle TOS updates at time of registration. 32 $terms_of_service_error = ! $terms_of_service || $terms_of_service > TOS_REVISION; 33 28 34 // handle user registrations. 29 if ( ! $error_user_login && ! $error_user_email ) {35 if ( ! $error_user_login && ! $error_user_email && ! $terms_of_service_error ) { 30 36 if ( ! wporg_login_check_recapcha_status( 'register' ) ) { 31 37 $error_recapcha_status = true; 32 38 } else { 33 wporg_login_create_pending_user( $user_login, $user_email, $user_mailinglist );39 wporg_login_create_pending_user( $user_login, $user_email, $user_mailinglist, $terms_of_service ); 34 40 die(); 35 41 } … … 79 85 ?> 80 86 81 <p class="login-mailinglist"> 87 <p class="login-tos checkbox <?php if ( $terms_of_service_error ) { echo 'message error'; } ?>"> 88 <label for="terms_of_service"> 89 <input name="terms_of_service" type="checkbox" id="terms_of_service" value="<?php echo esc_attr( TOS_REVISION ); ?>" <?php checked( $terms_of_service, TOS_REVISION ); ?> required="required"> 90 <?php 91 $localised_domain = parse_url( wporg_login_wordpress_url(), PHP_URL_HOST ); 92 printf( 93 __( 'I have read and accept the %s.', 'wporg' ), 94 wp_sprintf_l( '%l', [ 95 "<a href='https://{$localised_domain}/about/privacy/'>" . __( 'Privacy Policy', 'wporg' ) . '</a>', 96 // "<a href='https://{$localised_domain}/about/terms-of-service/'>" . __( 'Terms of Service', 'wporg' ) . '</a>', 97 // "<a href='https://{$localised_domain}/about/code-of-conduct/'>" . __( 'Code of Conduct', 'wporg' ) . '</a>', 98 ] ) 99 ) 100 ?> 101 </label> 102 </p> 103 104 <p class="login-mailinglist checkbox"> 82 105 <label for="user_mailinglist"> 83 106 <input name="user_mailinglist" type="checkbox" id="user_mailinglist" value="true" <?php checked( $user_mailinglist, true ); ?>> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/stylesheets/login.css
r9836 r10899 453 453 } 454 454 455 form .login-mailinglist label { 455 form p.checkbox.error { 456 color: #dc3232; 457 } 458 459 form p.checkbox label { 456 460 position: relative; 457 461 display: block; … … 461 465 } 462 466 463 .rtl form .login-mailinglistlabel {467 .rtl form p.checkbox label { 464 468 padding-left: 0; 465 469 padding-right: 24px; … … 467 471 468 472 @media screen and (max-width: 782px) { 469 form .login-mailinglistlabel {473 form p.checkbox label { 470 474 padding-left: 33px; 471 475 } 472 476 473 .rtl form .login-mailinglistlabel {477 .rtl form p.checkbox label { 474 478 padding-left: 0; 475 479 padding-right: 33px; … … 477 481 } 478 482 479 form .login-mailinglistlabel input {483 form p.checkbox label input { 480 484 position: absolute; 481 485 top: 0; … … 484 488 } 485 489 486 .rtl form .login-mailinglistlabel input {490 .rtl form p.checkbox label input { 487 491 left: auto; 488 492 right: 0;
Note: See TracChangeset
for help on using the changeset viewer.