Manual:Hooks/UserLoginForm
![]() | This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility. This feature was deprecated in version 1.27.0. |
UserLoginForm | |
---|---|
Available from version 1.6.0 Change to manipulate the login form |
|
Define function: |
public static function onUserLoginForm( &$template ) { ... }
|
Attach hook: |
In extension.json: {
"Hooks": {
"UserLoginForm": "MyExtensionHooks::onUserLoginForm"
}
}
|
Called from: | File(s): specials/SpecialUserLogin.php |
Interface: | UserLoginFormHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:UserLoginForm extensions.
Details[edit]
- &$template: UsercreateTemplate instance for the form
Deprecated[edit]
From MediaWiki 1.27 on, the hook is deprecated and superseded by AuthManager functionality. Login form fields should be added by some authentication provider returning an instance of an appropriate AuthenticationRequest
subclass instance in getAuthenticationRequests()
, and that object can define the fields via getFieldInfo()
. The authentication provider can read the submitted data from the AuthenticationRequest
object via its testForAuthentication
or beginPrimaryAuthentication
/continueAuthentication
methods.
For purely cosmetic changes to the form, which don't need to be reflected to the API (such as adding more information or interactive widgets) the AuthChangeFormFields hook can be used.