Manual:Hooks/PrefsPasswordAudit

From MediaWiki.org
Jump to: navigation, search
PrefsPasswordAudit
Available from version 1.11.0
called when user changes his password

Define function:
public static function onPrefsPasswordAudit( $user, $newPass, $error ) { ... }

Attach hook:
$wgHooks['PrefsPasswordAudit'][] = 'MyExtensionHooks::onPrefsPasswordAudit';
Called from: SpecialPreferences.php, SpecialResetpass.php

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

Called from SpecialPreferences.php in versions 1.11.0 - 1.13. Called from SpecialResetpass.php from 1.14 onward

Details [edit]

  • $user: User (object) changing his password
  • $newPass: new password
  • $error: error (string) 'badretype', 'wrongpassword', 'error' or 'success'