Making WordPress.org


Ignore:
Timestamp:
09/23/2019 03:52:23 AM (6 years ago)
Author:
dd32
Message:

Login: Store user registrations in a custom table until they confirm their email address (at which time, we create the actual wp_users records).

This is to combat the significant number of unconfirmed accounts that are created, by separating them it's easier to purge them periodically, but also easier to add extra anti-spam checks as needed.

See #4739.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-restapi.php

    r6493 r9146  
    3636    }
    3737
     38    // Check we don't have a pending registration for that username.
     39    if ( $pending = wporg_get_pending_user( $login ) ) {
     40        return [
     41            'available' => false,
     42            'error' => __( 'That username is already in use.', 'wporg' ) . '<br>' . __( 'The registration is still pending, please check your email for the confirmation link.', 'wporg' ),
     43            'avatar' => get_avatar( $pending->user_email, 64 ),
     44        ];
     45    }
     46
    3847    // Perform general validations.
    3948    $validate_signup_error = $validate_signup['errors']->get_error_message( 'user_name' );
     
    6170    }
    6271
     72    // Check we don't have a pending registration for that email.
     73    if ( $pending = wporg_get_pending_user( $email ) ) {
     74        return [
     75            'available' => false,
     76            'error' => __( 'That email address already has an account.', 'wporg' ) . '<br>' . __( 'The registration is still pending, please check your email for the confirmation link.', 'wporg' ),
     77            'avatar' => get_avatar( $email, 64 ),
     78        ];
     79    }
     80
    6381    $validate_signup = wpmu_validate_user_signup( '', $email );
    6482    $validate_signup_error = $validate_signup['errors']->get_error_message( 'user_email' );
Note: See TracChangeset for help on using the changeset viewer.