Mediawiki 中的 HTML AuthenticationRequest

An HTML AuthenticationRequest in Mediawiki

新的 MediaWiki Auth API 使用 AuthenticationRequests 而不是普通的 insert-HTML-in-login-form 钩子。但是 AuthenticationRequest::getFieldInfo 不支持纯 HTML 字段类型。

有没有其他方法可以发出 HTML AuthenticationRequest?不是按钮、密码或任何东西,只是 HTML 标签 <span>

如果您不需要添加任何输入字段,而只是一个信息块,您可以使用 AuthChangeFormFields 挂钩来修改身份验证表单 html。

例如:

...
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>'
  );

}
...