diff --git a/OAuth2Client.php b/OAuth2Client.php index f3ac812..5f5fe42 100644 --- a/OAuth2Client.php +++ b/OAuth2Client.php @@ -51,6 +51,7 @@ $wgHooks['PersonalUrls'][] = 'OAuth2ClientHooks::onPersonalUrls'; $wgHooks['UserLogout'][] = 'OAuth2ClientHooks::onUserLogout'; +$wgHooks['GetPreferences'][] = 'OAuth2ClientHooks::RedirectPrefs'; class OAuth2ClientHooks { public static function onPersonalUrls( array &$personal_urls, Title $title ) { @@ -118,6 +119,13 @@ public static function onUserLogout( &$user ) { return true; } + // Remove reset password link and remember password checkbox from preferences page + public static function RedirectPrefs($user, &$preferences) { + unset($preferences["password"]); + unset($preferences["rememberpassword"]); + return true; + } + public static function getOAuth2VendorClassPath() { return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'vendors' . DIRECTORY_SEPARATOR . 'oauth_2'; } diff --git a/SpecialOAuth2Client.php b/SpecialOAuth2Client.php index 262735c..2598eb2 100644 --- a/SpecialOAuth2Client.php +++ b/SpecialOAuth2Client.php @@ -127,7 +127,7 @@ private function _handleCallback(){ unset( $_SESSION['returnto'] ); } - if( !$title instanceof Title || 0 > $title->mArticleID ) { + if( !$title instanceof Title ) { $title = Title::newMainPage(); } $wgOut->redirect( $title->getFullURL() );