namespace MediaWiki\Auth;
-use StatusValue;
use User;
/**
if ( !is_array( $state ) ) {
return AuthenticationResponse::newAbstain();
}
- $maybeLink = $state['maybeLink'];
+
+ $maybeLink = array_filter( $state['maybeLink'], function ( $req ) use ( $user ) {
+ if ( !$req->action ) {
+ $req->action = AuthManager::ACTION_CHANGE;
+ }
+ $req->username = $user->getName();
+ return $this->manager->allowsAuthenticationDataChange( $req )->isGood();
+ } );
if ( !$maybeLink ) {
return AuthenticationResponse::newAbstain();
}
$req = new ConfirmLinkAuthenticationRequest( $maybeLink );
return AuthenticationResponse::newUI(
[ $req ],
- wfMessage( 'authprovider-confirmlink-message' )
+ wfMessage( 'authprovider-confirmlink-message' ),
+ 'warning'
);
}
'linkOk', wfMessage( 'ok' ), wfMessage( 'authprovider-confirmlink-ok-help' )
)
],
- $combinedStatus->getMessage( 'authprovider-confirmlink-failed' )
+ $combinedStatus->getMessage( 'authprovider-confirmlink-failed' ),
+ 'error'
);
}
}