Making WordPress.org

Changeset 4963


Ignore:
Timestamp:
02/20/2017 11:37:30 PM (8 years ago)
Author:
ocean90
Message:

WordPress.org SSO: Add registration paths only when registration is open.

See #148.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r4962 r4963  
    2222            'lostpassword' => '/lostpassword',
    2323            'oauth'        => '/oauth',
    24             'register-profile' => '/register/profile/(?P<profile_user>[^/]+)/(?P<profile_nonce>[^/]+)',
    25             'register-confirm' => '/register/confirm/(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+)',
    26             'register'         => '/register',
    2724        );
    2825
     
    138135            if ( is_user_logged_in() ) {
    139136                $this->valid_sso_paths['logout'] = '/logout';
     137            }
     138
     139            // Extend registration paths only when registration is open.
     140            if ( 'user' === get_site_option( 'registration', 'none' ) ) {
     141                $this->valid_sso_paths['register-profile'] = '/register/profile/(?P<profile_user>[^/]+)/(?P<profile_nonce>[^/]+)';
     142                $this->valid_sso_paths['register-confirm'] = '/register/confirm/(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+)';
     143                $this->valid_sso_paths['register']         = '/register';
    140144            }
    141145
Note: See TracChangeset for help on using the changeset viewer.