Changeset 2204 for sites/trunk/common/includes/wporg-sso/wp-plugin.php
- Timestamp:
- 12/18/2015 05:32:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/wp-plugin.php
r2166 r2204 63 63 // And actually redirect to the SSO login 64 64 $this->_safe_redirect( $redirect_to_sso_login ); 65 65 66 } else { 66 67 // Otherwise, filter the login_url to point to the SSO 67 68 add_action( 'login_url', array( &$this, 'login_url' ), 10, 2 ); 68 69 } 70 69 71 } else if ( self::SSO_HOST === $this->host ) { 70 72 // If on the SSO host 71 73 if ( ! preg_match( '/\/wp-login\.php$/', $this->script ) ) { 72 // ... but not on its login or signup screen. 73 // TODO: Relax rules when we want more out of our theme then bypassing it altogether with redirects. 74 if ( is_user_logged_in() ) { 75 // Mimic what happens after a login without a specified redirect. 74 // ... but not on its login screen. 75 if ( preg_match( '/^\/oauth([\/\?]{1}.*)?$/', $_SERVER['REQUEST_URI'] ) ) { 76 // Let the theme render for oauth paths (/oauth, /oauth/, /oauth/*, but not /notoauth or /oauthnot) 77 return; 78 } else if ( is_user_logged_in() ) { 79 // Or mimic what happens after a login without a specified redirect (send to profile). 76 80 $this->_safe_redirect( 'https://wordpress.org/support/profile/' . get_currentuserinfo()->user_login ); 77 81 } else { … … 79 83 $this->_safe_redirect( $this->sso_login_url ); 80 84 } 85 81 86 } else { 82 87 // if on login screen, filter network_site_url to make sure our forms go to the SSO host, not wordpress.org
Note: See TracChangeset
for help on using the changeset viewer.