Changeset 9833
- Timestamp:
- 05/07/2020 02:38:43 AM (6 years ago)
- Location:
- sites/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/wp-plugin.php
r9832 r9833 161 161 if ( 'user' === get_site_option( 'registration', 'none' ) ) { 162 162 // New "pending" registration flow. 163 $this->valid_sso_paths['pending-profile'] = '/register/create-profile /(?P<profile_user>[^/]+)/(?P<profile_key>[^/]+)';164 $this->valid_sso_paths['pending-create'] = '/register/create /(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+)';163 $this->valid_sso_paths['pending-profile'] = '/register/create-profile(/(?P<profile_user>[^/]+)/(?P<profile_key>[^/]+))?'; 164 $this->valid_sso_paths['pending-create'] = '/register/create(/(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+))?'; 165 165 166 166 // Primary registration route. -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-create.php
r9224 r9833 6 6 */ 7 7 8 $activation_user = WP_WPOrg_SSO::$matched_route_params['confirm_user'] ?? false; 9 $activation_key = WP_WPOrg_SSO::$matched_route_params['confirm_key'] ?? false; 8 // Clear the pending cookies, they're no longer needed. 9 if ( isset( $_COOKIE['wporg_profile_user'] ) ) { 10 setcookie( 'wporg_profile_user', false, time()-DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true ); 11 setcookie( 'wporg_profile_key', false, time()-DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true ); 12 } 13 14 // Migrate to cookies. 15 if ( !empty( WP_WPOrg_SSO::$matched_route_params['confirm_user'] ) ) { 16 setcookie( 'wporg_confirm_user', WP_WPOrg_SSO::$matched_route_params['confirm_user'], time()+DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true ); 17 setcookie( 'wporg_confirm_key', WP_WPOrg_SSO::$matched_route_params['confirm_key'], time()+DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true ); 18 19 wp_safe_redirect( '/register/create' ); 20 die(); 21 } 22 23 $activation_user = $_COOKIE['wporg_confirm_user'] ?? false; 24 $activation_key = $_COOKIE['wporg_confirm_key'] ?? false; 10 25 11 26 $pending_user = wporg_get_pending_user( $activation_user ); … … 36 51 37 52 if ( ! $can_access ) { 38 wp_safe_redirect( "/");53 wp_safe_redirect( '/' ); 39 54 die(); 40 55 } … … 61 76 $user = wporg_login_create_user_from_pending( $pending_user, $user_pass ); 62 77 if ( $user ) { 78 setcookie( 'wporg_confirm_user', false, time()-DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true ); 79 setcookie( 'wporg_confirm_key', false, time()-DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true ); 80 81 // Log the user in 63 82 wp_set_current_user( $user->ID ); 64 83 wp_set_auth_cookie( $user->ID, true ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-profile.php
r9831 r9833 6 6 */ 7 7 8 $profile_user = WP_WPOrg_SSO::$matched_route_params['profile_user'] ?? false; 9 $profile_key = WP_WPOrg_SSO::$matched_route_params['profile_key'] ?? false; 8 // Migrate to cookies. 9 if ( !empty( WP_WPOrg_SSO::$matched_route_params['profile_user'] ) ) { 10 setcookie( 'wporg_profile_user', WP_WPOrg_SSO::$matched_route_params['profile_user'], time()+DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true ); 11 setcookie( 'wporg_profile_key', WP_WPOrg_SSO::$matched_route_params['profile_key'], time()+DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true ); 12 13 wp_safe_redirect( '/register/create-profile' ); 14 die(); 15 } 16 17 $profile_user = $_COOKIE['wporg_profile_user'] ?? false; 18 $profile_key = $_COOKIE['wporg_profile_key'] ?? false; 10 19 11 20 $pending_user = wporg_get_pending_user( $profile_user ); … … 29 38 die(); 30 39 } elseif ( ! $can_access ) { 31 wp_safe_redirect( home_url( '/linkexpired /' ) );40 wp_safe_redirect( home_url( '/linkexpired' ) ); 32 41 die(); 33 42 }
Note: See TracChangeset
for help on using the changeset viewer.