15 AuthManager::ACTION_LINK, AuthManager::ACTION_LINK_CONTINUE,
19 parent::__construct(
'LinkAccounts' );
27 return MediaWikiServices::getInstance()->getAuthManager()->canLinkAccounts();
31 return $this->
getConfig()->get(
'ChangeCredentialsBlacklist' );
44 if ( $this->authAction === AuthManager::ACTION_LINK ) {
46 $titleMessage = $this->
msg(
'cannotlink-no-provider-title' );
47 $errorMessage = $this->
msg(
'cannotlink-no-provider' );
62 if ( $status ===
false || !$status->isOK() ) {
67 $response = $status->getValue();
69 switch ( $response->status ) {
70 case AuthenticationResponse::PASS:
73 case AuthenticationResponse::FAIL:
74 $this->
loadAuth(
'', AuthManager::ACTION_LINK,
true );
75 $this->
displayForm( StatusValue::newFatal( $response->message ) );
77 case AuthenticationResponse::REDIRECT:
78 $this->
getOutput()->redirect( $response->redirectTarget );
80 case AuthenticationResponse::UI:
81 $this->authAction = AuthManager::ACTION_LINK_CONTINUE;
82 $this->authRequests = $response->neededRequests;
83 $this->
displayForm( StatusValue::newFatal( $response->message ) );
86 throw new LogicException(
'invalid AuthenticationResponse' );
91 return AuthManager::ACTION_LINK;
100 $form = parent::getAuthForm( $requests, $action );
101 $form->setSubmitTextMsg(
'linkaccounts-submit' );
109 $this->
loadAuth(
'', AuthManager::ACTION_LINK,
true );
110 $this->
displayForm( StatusValue::newFatal( $this->
msg(
'linkaccounts-success-text' ) ) );
A special page subclass for authentication-related special pages.
isActionAllowed( $action)
Checks whether AuthManager is ready to perform the action.
displayForm( $status)
Display the form.
loadAuth( $subPage, $authAction=null, $reset=false)
Load or initialize $authAction, $authRequests and $subPage.
string $subPage
Subpage of the special page.
trySubmit()
Attempts to do an authentication step with the submitted data.
An error page which can definitely be safely rendered using the OutputPage.
Links/unlinks external accounts to the current user.
success()
Show a success message.
isListed()
Whether this special page is listed in Special:SpecialPages Stable to override.
getAuthForm(array $requests, $action)
getRequestBlacklist()
Allows blacklisting certain request types.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getDefaultAction( $subPage)
Get the default action for this special page, if none is given via URL/POST data.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!...
getOutput()
Get the OutputPage being used for this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
getPageTitle( $subpage=false)
Get a self-referential title object.