Changeset 4189 for sites/trunk/common/includes/wporg-sso/wp-plugin.php
- Timestamp:
- 10/05/2016 11:29:13 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/wp-plugin.php
r4120 r4189 60 60 add_filter( 'allowed_redirect_hosts', array( &$this, 'add_allowed_redirect_host' ) ); 61 61 62 // Replace the lost password URL by our own 63 add_filter( 'lostpassword_url', array( &$this, 'lostpassword_url' ), 10, 2 ); 62 // Replace some URLs by our own. 63 add_filter( 'lostpassword_url', array( &$this, 'lostpassword_url' ), 20, 2 ); 64 add_filter( 'site_url', array( $this, 'login_post_url' ), 20, 3 ); 65 add_filter( 'register_url', array( $this, 'register_url' ), 20 ); 64 66 65 67 if ( preg_match( '!/wp-signup\.php$!', $this->script ) ) { … … 86 88 } else { 87 89 // Otherwise, filter the login_url to point to the SSO 88 add_ action( 'login_url', array( &$this, 'login_url' ), 10, 2 );90 add_filter( 'login_url', array( $this, 'login_url' ), 20, 2 ); 89 91 } 90 92 … … 163 165 } 164 166 167 /** 168 * Filters the default login lost URL and returns our custom one instead. 169 * 170 * @param string $url The complete site URL including scheme and path. 171 * @param string $path Path relative to the site URL. Blank string if no path is specified. 172 * @param string|null $scheme Site URL context. 173 * @return string 174 */ 175 public function login_post_url( $url, $path, $scheme ) { 176 if ( 'login_post' === $scheme ) { 177 return $this->sso_host_url . '/wp-login.php'; 178 } 179 180 return $url; 181 } 182 183 /** 184 * Filters the default registration URL and returns our custom one instead. 185 * 186 * @return string 187 */ 188 public function register_url() { 189 return $this->sso_signup_url; 190 } 165 191 166 192 /** … … 186 212 */ 187 213 public function lostpassword_url( $lostpassword_url, $redirect ) { 188 return home_url( $this->valid_sso_paths['lostpassword'] . '/?redirect_to=' . $redirect );214 return $this->sso_host_url . $this->valid_sso_paths['lostpassword'] . '/?redirect_to=' . $redirect; 189 215 } 190 216
Note: See TracChangeset
for help on using the changeset viewer.