The AuthManager service is only used in one method call in the SpecialPage class, so make it optional and provide it when needed with a setter/getter. Use the getter also in some sub classes which needs an AuthManager as well. Bug: T259960 Change-Id: Ib0cbdb719d2a748622d843824b73ebb4c29fab89
30 lines
745 B
PHP
30 lines
745 B
PHP
<?php
|
|
|
|
use MediaWiki\Auth\AuthManager;
|
|
|
|
/**
|
|
* Special change to remove credentials (such as a two-factor token).
|
|
*/
|
|
class SpecialRemoveCredentials extends SpecialChangeCredentials {
|
|
protected static $allowedActions = [ AuthManager::ACTION_REMOVE ];
|
|
|
|
protected static $messagePrefix = 'removecredentials';
|
|
|
|
protected static $loadUserData = false;
|
|
|
|
/**
|
|
* @param AuthManager $authManager
|
|
*/
|
|
public function __construct( AuthManager $authManager ) {
|
|
parent::__construct( $authManager );
|
|
$this->mName = 'RemoveCredentials';
|
|
}
|
|
|
|
protected function getDefaultAction( $subPage ) {
|
|
return AuthManager::ACTION_REMOVE;
|
|
}
|
|
|
|
protected function getRequestBlacklist() {
|
|
return $this->getConfig()->get( 'RemoveCredentialsBlacklist' );
|
|
}
|
|
}
|