[go: up one dir, main page]

Jump to content

Manual:Hooks/isValidPassword

From mediawiki.org
isValidPassword
Available from version 1.11.0
Override the result of User::isValidPassword()
Define function:
public static function onisValidPassword( $password, &$result, $user ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"isValidPassword": "MediaWiki\\Extension\\MyExtension\\Hooks::onisValidPassword"
	}
}
Called from: File(s): User.php
Interface: isValidPasswordHook.php

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

Details

[edit]
  • $password: Desired password.
  • &$result: Set this and return false to override the internal checks.
  • $user: User the password is being validated for.