Making WordPress.org


Ignore:
Timestamp:
10/23/2019 06:09:31 AM (6 years ago)
Author:
dd32
Message:

Login: Add a link expired template, and redirect expierd links to that url.

See #4739.

File:
1 edited

Legend:

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

    r9167 r9224  
    1111$pending_user = wporg_get_pending_user( $activation_user );
    1212if ( ! $pending_user ) {
    13     // TODO: add a handler for "Link is expired". The pending user record has been purged.
    14     // See Line 33 below for the second case where this is needed.
     13    wp_safe_redirect( home_url( '/linkexpired/register/' . urlencode( $activation_user ) ) );
     14    exit;
    1515}
    1616
    1717$can_access = false;
    1818if ( $pending_user && $pending_user['user_activation_key'] && ! $pending_user['created'] ) {
    19     $expiration_duration = WEEK_IN_SECONDS; // Time that the user has to confirm the account.
     19    $expiration_duration = 2 * WEEK_IN_SECONDS; // Time that the user has to confirm the account.
    2020
    2121    list( $user_request_time, $hashed_activation_key ) = explode( ':', $pending_user['user_activation_key'], 2 );
     
    2727        $can_access = true;
    2828    } elseif ( $hash_is_correct ) {
    29         // TODO: Add a handler for "Link is expired".
    30         // For now, ignore the expiry date on the email links.
    31         // This URL is invalidated once the user is created anyway.
    32         $can_access = true;
     29        wp_safe_redirect( home_url( '/linkexpired/register/' . urlencode( $activation_user ) ) );
     30        exit;
    3331    }
    3432} elseif ( $pending_user && $pending_user['created'] ) {
Note: See TracChangeset for help on using the changeset viewer.