14 AuthManager::ACTION_LINK, AuthManager::ACTION_LINK_CONTINUE,
21 parent::__construct(
'LinkAccounts' );
34 return $this->
getConfig()->get(
'ChangeCredentialsBlacklist' );
47 if ( $this->authAction === AuthManager::ACTION_LINK ) {
49 $titleMessage = $this->
msg(
'cannotlink-no-provider-title' );
50 $errorMessage = $this->
msg(
'cannotlink-no-provider' );
65 if ( $status ===
false || !$status->isOK() ) {
70 $response = $status->getValue();
72 switch ( $response->status ) {
73 case AuthenticationResponse::PASS:
76 case AuthenticationResponse::FAIL:
77 $this->
loadAuth(
'', AuthManager::ACTION_LINK,
true );
78 $this->
displayForm( StatusValue::newFatal( $response->message ) );
80 case AuthenticationResponse::REDIRECT:
81 $this->
getOutput()->redirect( $response->redirectTarget );
83 case AuthenticationResponse::UI:
84 $this->authAction = AuthManager::ACTION_LINK_CONTINUE;
85 $this->authRequests = $response->neededRequests;
86 $this->
displayForm( StatusValue::newFatal( $response->message ) );
89 throw new LogicException(
'invalid AuthenticationResponse' );
94 return AuthManager::ACTION_LINK;
103 $form = parent::getAuthForm( $requests, $action );
104 $form->setSubmitTextMsg(
'linkaccounts-submit' );
112 $this->
loadAuth(
'', AuthManager::ACTION_LINK,
true );
113 $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.
__construct(AuthManager $authManager)
success()
Show a success message.
isListed()
Whether this special page is listed in Special:SpecialPages.
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.
AuthManager null $authManager
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
setAuthManager(AuthManager $authManager)
Set the injected AuthManager from the special page constructor.
getPageTitle( $subpage=false)
Get a self-referential title object.