Making WordPress.org


Ignore:
Timestamp:
06/21/2021 05:36:48 AM (3 years ago)
Author:
dd32
Message:

Login: When a user is logged in, or an account creation link has already been used, redirect the user more appropriately to a page explaining the issue.

This removes a "random" redirect on certain Login pages that would result in the user redirected to the WordPress.org homepage, or support forums, with no further explanation.

Fixes #5754.

File:
1 edited

Legend:

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

    r10981 r11046  
    88$sso = WPOrg_SSO::get_instance();
    99
    10  // Migrate to cookies.
     10// Migrate to cookies.
    1111if ( !empty( $sso::$matched_route_params['profile_user'] ) ) {
    1212    setcookie( 'wporg_profile_user', $sso::$matched_route_params['profile_user'], time()+DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true );
     
    2121
    2222$pending_user = wporg_get_pending_user( $profile_user );
     23
     24// Already logged in.. Warn about duplicate accounts, etc.
     25if ( is_user_logged_in() ) {
     26    wp_safe_redirect( home_url( '/linkexpired/register-logged-in' ) );
     27    exit;
     28}
    2329
    2430$can_access = false;
     
    3743
    3844if ( $can_access && $pending_user['created']  ) {
    39     wp_safe_redirect( 'https://wordpress.org/support/' );
     45    wp_safe_redirect( home_url( '/linkexpired/account-created/' . urlencode( $pending_user['user_login'] ) ) );
    4046    die();
    4147} elseif ( ! $can_access ) {
Note: See TracChangeset for help on using the changeset viewer.