mediawiki-extensions-OATHAuth/special/SpecialOATH.php
Reedy 0f5772e7bd Remove SpecialOATHLogin.php as more AuthManager related cleanup
Change-Id: I9d7fd0a2da0e3e54bb5031d7e70769a2a27703c8
2017-04-01 16:51:41 +01:00

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';
}
}