Making WordPress.org

Changeset 12834


Ignore:
Timestamp:
08/11/2023 05:54:47 AM (18 months ago)
Author:
dd32
Message:

Login: When a user attempts to signup again using the same username that is currently pending approval, don't offer to resend the email, but instead that it's pending.

This avoids a case where the user see's a "resend confirmation email" which never actually works.

See [12811].

File:
1 edited

Legend:

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

    r12811 r12834  
    4646
    4747    // Check we don't have a pending registration for that username.
    48     if ( $pending = wporg_get_pending_user( $login ) ) {
     48    $pending = wporg_get_pending_user( $login );
     49    if ( $pending && ! $pending['cleared'] ) {
     50        // Account is in pending state, but requires manual human review, don't suggest sending a reset email.
     51        $sso = WPOrg_SSO::get_instance();
     52
     53        return [
     54            'available' => false,
     55            'error' => sprintf(
     56                __( 'That username is already in use.', 'wporg' ) . '<br>' .
     57                /* translators: %s Email address */
     58                __( 'Your account is pending approval. You will receive an email at %s to set your password when approved.', 'wporg' ) .
     59                /* translators: %s Email address */
     60                '<br>' . __( 'Please contact %s for more details.', 'wporg' ),
     61                '<code>' . esc_html( $pending['user_email'] ) . '</code>',
     62                '<a href="mailto:' . $sso::SUPPORT_EMAIL . '">' . $sso::SUPPORT_EMAIL . '</a>'
     63            ),
     64            'avatar' => get_avatar( $email, 64 ),
     65        ];
     66    } elseif ( $pending ) {
    4967        return [
    5068            'available' => false,
Note: See TracChangeset for help on using the changeset viewer.