Manual:Hooks/LoginAuthenticateAudit

From MediaWiki.org
Jump to: navigation, search
LoginAuthenticateAudit
Available from version 1.10.0
Removed in version 1.27.0
A login attempt for a valid user account either succeeded or failed. No return data is accepted; this hook is for auditing only.
Define function:
public static function onLoginAuthenticateAudit( $user, $password, $retval ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"LoginAuthenticateAudit": [
			"MyExtensionHooks::onLoginAuthenticateAudit"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['LoginAuthenticateAudit'][] = 'MyExtensionHooks::onLoginAuthenticateAudit';
Called from: File(s): SpecialUserlogin.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:LoginAuthenticateAudit extensions.

Details[edit]

  • $user - The User object being authenticated against.
  • $password - The password being submitted and found wanting.
  • $retval - A LoginForm class constant with authenticateUserData() return value (SUCCESS, WRONG_PASS, etc).

With the introduction of AuthManager in 1.27, this hook was replaced by AuthManagerLoginAuthenticateAuditTemplate:Enlink/list1.