Available from version 1.16.0
Removed in version 1.18.0
Block users from emailing passwords
Define function:
public static function onUserLoginMailPassword( $name, &$error ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"UserLoginMailPassword": "MyExtensionHooks::onUserLoginMailPassword"

For MediaWiki ≤1.25:

$wgHooks['UserLoginMailPassword'][] = 'MyExtensionHooks::onUserLoginMailPassword';
Called from:File(s): specials/SpecialUserLogin.php

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


  • $name: the username to email the password of.
  • &$error: out-param - the error message to return.