Alexander Yakovlev
Alexander Yakovlev

Reputation: 215

An HTML AuthenticationRequest in Mediawiki

The new MediaWiki Auth API utilizes AuthenticationRequests instead of plain insert-HTML-in-login-form hooks. But AuthenticationRequest::getFieldInfo doesn't support plain HTML field type.

Is there any other way I can make an HTML AuthenticationRequest? Not a button, password or anything, just HTML tag <span>

Upvotes: 0

Views: 45

Answers (1)

wakalaka
wakalaka

Reputation: 533

If you don't need to add any input fields, but just an information block you can use AuthChangeFormFields hook to modify authentication form html.

For example:

...
public static function onAuthChangeFormFields( $requests, $fieldInfo, &$formDescriptor, $action ) {

  // Add span
  $formDescriptor['my_span'] = array(
    'type' => 'info',
    'raw' => true,
    'weight' => 500,
    'default' => '<span>My span with information</span>'
  );

}
...

Upvotes: 1

Related Questions