Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

remove password and rememberpassword options #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions OAuth2Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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';
}
Expand Down
2 changes: 1 addition & 1 deletion SpecialOAuth2Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down