Making WordPress.org

Changeset 12811


Ignore:
Timestamp:
08/07/2023 02:43:56 AM (18 months ago)
Author:
dd32
Message:

Login: When a user attempts to signup again using an email which has a pending account in a approval-required state, inform the user to email us.

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

File:
1 edited

Legend:

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

    r12430 r12811  
    102102    }
    103103
    104     if ( $pending && ! $pending['created'] ) {
     104    if ( $pending && ! $pending['created'] && ! $pending['cleared'] ) {
     105        // Account is in pending state, but requires manual human review, don't suggest sending a reset email.
     106        $sso = WPOrg_SSO::get_instance();
     107
     108        return [
     109            'available' => false,
     110            'error' => sprintf(
     111                __( 'That email address already has an account.', 'wporg' ) . '<br>' .
     112                /* translators: %s Email address */
     113                __( 'Your account is pending approval. You will receive an email at %s to set your password when approved.', 'wporg' ) .
     114                /* translators: %s Email address */
     115                '<br>' . __( 'Please contact %s for more details.', 'wporg' ),
     116                '<code>' . esc_html( $pending['user_email'] ) . '</code>',
     117                '<a href="mailto:' . $sso::SUPPORT_EMAIL . '">' . $sso::SUPPORT_EMAIL . '</a>'
     118            ),
     119            'avatar' => get_avatar( $email, 64 ),
     120        ];
     121
     122    } elseif ( $pending && ! $pending['created'] ) {
     123        // Account is in pending state, just needs the user to click through on the email, offer to resend the email.
    105124        return [
    106125            'available' => false,
Note: See TracChangeset for help on using the changeset viewer.