mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-12-03 20:36:29 +00:00
67c7dd10e7
Add configuration variable for specifying what database the OATH credentials are stored in, that way wikis that use CentralAuth can centralize their two-factor authentication data as well. Bug: T100374 Change-Id: I285e2fe29fee43ddc6c5a6e51823911d43c596f6
28 lines
679 B
PHP
28 lines
679 B
PHP
<?php
|
|
|
|
/**
|
|
* Proxy page that redirects to the proper OATH special page
|
|
*/
|
|
class SpecialOATH extends ProxySpecialPage {
|
|
/**
|
|
* If the user already has OATH enabled, show them a page to disable
|
|
* If the user has OATH disabled, show them a page to enable
|
|
*
|
|
* @return SpecialOATHDisable|SpecialOATHEnable|SpecialPage
|
|
*/
|
|
protected function getTargetPage() {
|
|
$repo = OATHAuthHooks::getOATHUserRepository();
|
|
$user = $repo->findByUser( $this->getUser() );
|
|
|
|
if ( $user->getKey() === null ) {
|
|
return new SpecialOATHEnable( $repo, $user );
|
|
} else {
|
|
return new SpecialOATHDisable( $repo, $user );
|
|
}
|
|
}
|
|
|
|
protected function getGroupName() {
|
|
return 'oath';
|
|
}
|
|
}
|