47 $session = $this->manager->getRequest()->getSession();
48 $state = $session->getSecret( $key );
49 if ( !is_array( $state ) ) {
53 $maybeLink = array_filter( $state[
'maybeLink'],
function ( $req ) use ( $user ) {
54 if ( !$req->action ) {
55 $req->action = AuthManager::ACTION_CHANGE;
57 $req->username = $user->getName();
58 return $this->manager->allowsAuthenticationDataChange( $req )->isGood();
67 wfMessage(
'authprovider-confirmlink-message' ),
91 $session = $this->manager->getRequest()->getSession();
92 $state = $session->getSecret( $key );
93 if ( !is_array( $state ) ) {
98 foreach ( $state[
'maybeLink'] as $linkReq ) {
99 $maybeLink[$linkReq->getUniqueId()] = $linkReq;
105 $state[
'maybeLink'] = [];
106 $session->setSecret( $key, $state );
110 foreach ( $req->confirmedLinkIDs as $id ) {
111 if ( isset( $maybeLink[$id] ) ) {
112 $req = $maybeLink[$id];
113 $req->username = $user->getName();
114 if ( !$req->action ) {
119 $status = $this->manager->allowsAuthenticationDataChange( $req );
120 $statuses[] = [ $req, $status ];
121 if ( $status->isGood() ) {
124 $this->manager->changeAuthenticationData( $req,
true );
134 $combinedStatus = \MediaWiki\Status\Status::newGood();
135 foreach ( $statuses as [ $req, $status ] ) {
136 $descriptionInfo = $req->describeCredentials();
138 'authprovider-confirmlink-option',
139 $descriptionInfo[
'provider']->text(), $descriptionInfo[
'account']->text()
141 if ( $status->isGood() ) {
142 $combinedStatus->error(
wfMessage(
'authprovider-confirmlink-success-line', $description ) );
145 'authprovider-confirmlink-failed-line', $description, $status->getMessage()->text()
155 $combinedStatus->getMessage(
'authprovider-confirmlink-failed' ),
wfMessage( $key,... $params)
This is the function for getting translated interface messages.