26 AuthManager::ACTION_LINK, AuthManager::ACTION_LINK_CONTINUE,
30 parent::__construct(
'LinkAccounts' );
55 if ( $this->authAction === AuthManager::ACTION_LINK ) {
57 $titleMessage = $this->
msg(
'cannotlink-no-provider-title' );
58 $errorMessage = $this->
msg(
'cannotlink-no-provider' );
73 if ( $status ===
false || !$status->isOK() ) {
78 $response = $status->getValue();
80 switch ( $response->status ) {
81 case AuthenticationResponse::PASS:
84 case AuthenticationResponse::FAIL:
85 $this->
loadAuth(
'', AuthManager::ACTION_LINK,
true );
86 $this->
displayForm( StatusValue::newFatal( $response->message ) );
88 case AuthenticationResponse::REDIRECT:
89 $this->
getOutput()->redirect( $response->redirectTarget );
91 case AuthenticationResponse::UI:
92 $this->authAction = AuthManager::ACTION_LINK_CONTINUE;
93 $this->authRequests = $response->neededRequests;
94 $this->
displayForm( StatusValue::newFatal( $response->message ) );
97 throw new LogicException(
'invalid AuthenticationResponse' );
102 return AuthManager::ACTION_LINK;
111 $form = parent::getAuthForm( $requests, $action );
112 $form->setSubmitTextMsg(
'linkaccounts-submit' );
120 $this->
loadAuth(
'', AuthManager::ACTION_LINK,
true );
121 $this->
displayForm( StatusValue::newFatal( $this->
msg(
'linkaccounts-success-text' ) ) );
126class_alias( SpecialLinkAccounts::class,
'SpecialLinkAccounts' );
An error page which can definitely be safely rendered using the OutputPage.
A class containing constants representing the names of configuration variables.
const ChangeCredentialsBlacklist
Name constant for the ChangeCredentialsBlacklist setting, for use with Config::get()
A special page subclass for authentication-related special pages.
string $subPage
Subpage of the special page.
displayForm( $status)
Display the form.
isActionAllowed( $action)
Checks whether AuthManager is ready to perform the action.
trySubmit()
Attempts to do an authentication step with the submitted data.
loadAuth( $subPage, $authAction=null, $reset=false)
Load or initialize $authAction, $authRequests and $subPage.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
setAuthManager(AuthManager $authManager)
Set the injected AuthManager from the special page constructor.
getPageTitle( $subpage=false)
Get a self-referential title object.
getConfig()
Shortcut to get main config object.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages By default the message key is the canonical name of...
Generic operation result class Has warning/error list, boolean status and arbitrary value.