$this->authAction = $this->isSignup() ? AuthManager::ACTION_CREATE_CONTINUE
: AuthManager::ACTION_LOGIN_CONTINUE;
$this->authRequests = $response->neededRequests;
- $this->mainLoginForm( $response->neededRequests, $response->message, 'warning' );
+ $this->mainLoginForm( $response->neededRequests, $response->message, $response->messageType );
break;
default:
throw new LogicException( 'invalid AuthenticationResponse' );
$form = $this->getAuthForm( $requests, $this->authAction, $msg, $msgtype );
$form->prepareForm();
- $formHtml = $form->getHTML( $msg ? Status::newFatal( $msg ) : false );
+ $submitStatus = Status::newGood();
+ if ( $msg && $msgtype === 'warning' ) {
+ $submitStatus->warning( $msg );
+ } elseif ( $msg && $msgtype === 'error' ) {
+ $submitStatus->fatal( $msg );
+ }
+ $formHtml = $form->getHTML( $submitStatus );
$out->addHTML( $this->getPageHtml( $formHtml ) );
}
'class' => 'mw-ui-flush-right mw-secure',
], $this->msg( 'userlogin-signwithsecure' )->text() );
}
+ $usernameHelpLink = '';
+ if ( !$this->msg( 'createacct-helpusername' )->isDisabled() ) {
+ $usernameHelpLink = Html::rawElement( 'span', [
+ 'class' => 'mw-ui-flush-right',
+ ], $this->msg( 'createacct-helpusername' )->parse() );
+ }
if ( $this->isSignup() ) {
$fieldDefinitions = [
'weight' => -105,
],
'username' => [
- 'label-message' => 'userlogin-yourname',
- // FIXME help-message does not match old formatting
- 'help-message' => 'createacct-helpusername',
+ 'label-raw' => $this->msg( 'userlogin-yourname' )->escaped() . $usernameHelpLink,
'id' => 'wpName2',
'placeholder-message' => $isLoggedIn ? 'createacct-another-username-ph'
: 'userlogin-yourname-ph',