34 parent::__construct( $query, $moduleName,
'ami' );
41 $manager = AuthManager::singleton();
43 'canauthenticatenow' => $manager->canAuthenticateNow(),
44 'cancreateaccounts' => $manager->canCreateAccounts(),
45 'canlinkaccounts' => $manager->canLinkAccounts(),
48 if ( $params[
'securitysensitiveoperation'] !==
null ) {
49 $ret[
'securitysensitiveoperationstatus'] = $manager->securitySensitiveOperationStatus(
50 $params[
'securitysensitiveoperation']
54 if ( $params[
'requestsfor'] ) {
55 $action = $params[
'requestsfor'];
57 $preservedReq = $helper->getPreservedRequest();
58 if ( $preservedReq ) {
60 'haspreservedstate' => $preservedReq->hasStateForAction( $action ),
61 'hasprimarypreservedstate' => $preservedReq->hasPrimaryStateForAction( $action ),
62 'preservedusername' => (string)$preservedReq->username,
66 'haspreservedstate' =>
false,
67 'hasprimarypreservedstate' =>
false,
68 'preservedusername' =>
'',
72 $reqs = $manager->getAuthenticationRequests( $action, $this->
getUser() );
76 case AuthManager::ACTION_CHANGE:
78 $reqs, $this->
getConfig()->
get(
'ChangeCredentialsBlacklist' )
81 case AuthManager::ACTION_REMOVE:
83 $reqs, $this->
getConfig()->
get(
'RemoveCredentialsBlacklist' )
88 $ret += $helper->formatRequests( $reqs );
100 'securitysensitiveoperation' =>
null,
103 AuthManager::ACTION_LOGIN,
104 AuthManager::ACTION_LOGIN_CONTINUE,
105 AuthManager::ACTION_CREATE,
106 AuthManager::ACTION_CREATE_CONTINUE,
107 AuthManager::ACTION_LINK,
108 AuthManager::ACTION_LINK_CONTINUE,
109 AuthManager::ACTION_CHANGE,
110 AuthManager::ACTION_REMOVE,
111 AuthManager::ACTION_UNLINK,
119 'action=query&meta=authmanagerinfo&amirequestsfor=' . urlencode( AuthManager::ACTION_LOGIN )
120 =>
'apihelp-query+authmanagerinfo-example-login',
121 'action=query&meta=authmanagerinfo&amirequestsfor=' . urlencode( AuthManager::ACTION_LOGIN ) .
122 '&amimergerequestfields=1'
123 =>
'apihelp-query+authmanagerinfo-example-login-merged',
124 'action=query&meta=authmanagerinfo&amisecuritysensitiveoperation=foo'
125 =>
'apihelp-query+authmanagerinfo-example-securitysensitiveoperation',
130 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Authmanagerinfo';