Manual:Hooks/ApiValidatePassword

From MediaWiki.org
Jump to navigation Jump to search
ApiValidatePassword
Available from version 1.29.0 (Gerrit change 324968)
This will allow for checking passwords against the wiki's password policy from the account creation and password change forms.
Define function:
public static function onApiValidatePassword( &$r ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ApiValidatePassword": "MyExtensionHooks::onApiValidatePassword"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ApiValidatePassword'][] = 'MyExtensionHooks::onApiValidatePassword';
Called from:File(s): ApiValidatePassword.php

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

Parameters[edit]

  • &$r: Result array.