mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-12-24 05:43:25 +00:00
7451a5df33
Change-Id: I2d2a917e5a22f88dc644eb3c33f775642728e1f4
29 lines
668 B
PHP
29 lines
668 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
|
|
*/
|
|
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';
|
|
}
|
|
}
|