47 parent::__construct( $query, $moduleName,
'ami' );
48 $this->authManager = $authManager;
55 'canauthenticatenow' => $this->authManager->canAuthenticateNow(),
56 'cancreateaccounts' => $this->authManager->canCreateAccounts(),
57 'canlinkaccounts' => $this->authManager->canLinkAccounts(),
60 if ( $params[
'securitysensitiveoperation'] !==
null ) {
61 $ret[
'securitysensitiveoperationstatus'] = $this->authManager->securitySensitiveOperationStatus(
62 $params[
'securitysensitiveoperation']
66 if ( $params[
'requestsfor'] ) {
67 $action = $params[
'requestsfor'];
69 $preservedReq = $helper->getPreservedRequest();
70 if ( $preservedReq ) {
72 'haspreservedstate' => $preservedReq->hasStateForAction( $action ),
73 'hasprimarypreservedstate' => $preservedReq->hasPrimaryStateForAction( $action ),
74 'preservedusername' => (string)$preservedReq->username,
78 'haspreservedstate' =>
false,
79 'hasprimarypreservedstate' =>
false,
80 'preservedusername' =>
'',
84 $reqs = $this->authManager->getAuthenticationRequests( $action, $this->
getUser() );
88 case AuthManager::ACTION_CHANGE:
90 $this->
getConfig()->
get( MainConfigNames::ChangeCredentialsBlacklist )
93 case AuthManager::ACTION_REMOVE:
95 $this->
getConfig()->
get( MainConfigNames::RemoveCredentialsBlacklist )
100 $ret += $helper->formatRequests( $reqs );
112 'securitysensitiveoperation' =>
null,
114 ParamValidator::PARAM_TYPE => [
115 AuthManager::ACTION_LOGIN,
116 AuthManager::ACTION_LOGIN_CONTINUE,
117 AuthManager::ACTION_CREATE,
118 AuthManager::ACTION_CREATE_CONTINUE,
119 AuthManager::ACTION_LINK,
120 AuthManager::ACTION_LINK_CONTINUE,
121 AuthManager::ACTION_CHANGE,
122 AuthManager::ACTION_REMOVE,
123 AuthManager::ACTION_UNLINK,
131 'action=query&meta=authmanagerinfo&amirequestsfor=' . urlencode( AuthManager::ACTION_LOGIN )
132 =>
'apihelp-query+authmanagerinfo-example-login',
133 'action=query&meta=authmanagerinfo&amirequestsfor=' . urlencode( AuthManager::ACTION_LOGIN ) .
134 '&amimergerequestfields=1'
135 =>
'apihelp-query+authmanagerinfo-example-login-merged',
136 'action=query&meta=authmanagerinfo&amisecuritysensitiveoperation=foo'
137 =>
'apihelp-query+authmanagerinfo-example-securitysensitiveoperation',
142 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Authmanagerinfo';
Helper class for AuthManager-using API modules.
static getStandardParams( $action,... $wantedParams)
Fetch the standard parameters this helper recognizes.
static blacklistAuthenticationRequests(array $reqs, array $remove)
Filter out authentication requests by class name.
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getModuleName()
Get the name of the module being executed by this instance.
A query action to return meta information about AuthManager state.
__construct(ApiQuery $query, $moduleName, AuthManager $authManager)
getHelpUrls()
Return links to more detailed help pages about the module.
getExamplesMessages()
Returns usage examples for this module.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
isReadMode()
Indicates whether this module requires read rights.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
This is a base class for all Query modules.
This is the main query class.
A class containing constants representing the names of configuration variables.