Making WordPress.org


Ignore:
Timestamp:
10/23/2019 06:09:31 AM (5 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/register-profile.php

    r6493 r9224  
    11<?php
    22/**
    3  * The post-register profile-fields Template
     3 * An old registration flow template, just redirects to a expired link template now.
    44 *
    55 * @package wporg-login
     
    77
    88$profile_user = isset( WP_WPOrg_SSO::$matched_route_params['profile_user'] ) ? WP_WPOrg_SSO::$matched_route_params['profile_user'] : false;
    9 $profile_nonce  = isset( WP_WPOrg_SSO::$matched_route_params['profile_nonce'] ) ? WP_WPOrg_SSO::$matched_route_params['profile_nonce'] : false;
    109
    11 $can_access = false;
    12 if (
    13     $profile_user && $profile_nonce &&
    14     ( $user = get_user_by( 'login', $profile_user ) ) &&
    15     $user->exists()
    16 ) {
    17     wp_set_current_user( $user->ID );
    18     $can_access = wp_verify_nonce( $profile_nonce, 'login-register-profile-edit' );
    19 }
    20 
    21 if ( ! $can_access ) {
    22     wp_set_current_user( 0 );
    23     wp_safe_redirect( '/' );
    24     die();
    25 }
    26 
    27 wporg_login_save_profile_fields();
    28 
    29 wp_enqueue_script( 'wporg-registration' );
    30 
    31 get_header();
    32 ?>
    33 <div class="message info">
    34     <p><?php
    35         printf(
    36             /* translators: %s Email address */
    37             __( 'Please check your email %s for a confirmation link to set your password.', 'wporg' ),
    38             '<code>' . esc_html( wp_get_current_user()->user_email ) . '</code>'
    39         );
    40     ?></p>
    41 </div>
    42 
    43 <p class="intro">
    44 <?php _e( 'Complete your WordPress.org Profile information.', 'wporg' ); ?>
    45 </p>
    46 
    47 <form name="registerform" id="registerform" action="" method="post">
    48 
    49     <?php include __DIR__ . '/partials/register-profilefields.php'; ?>
    50 
    51     <p class="login-submit">
    52         <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary" value="<?php esc_attr_e( 'Save Profile Information', 'wporg' ); ?>" />
    53     </p>
    54 
    55 </form>
    56 
    57 <p id="nav">
    58     <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
    59 </p>
    60 
    61 <?php get_footer(); ?>
     10wp_safe_redirect( home_url( '/linkexpired/lostpassword/' . urlencode( $profile_user ) ) );
     11exit;
Note: See TracChangeset for help on using the changeset viewer.