Manual:Hooks/PrefsEmailAudit

From MediaWiki.org
Jump to navigation Jump to search
PrefsEmailAudit
Available from version 1.11.0
called when user changes his email address
Define function:
public static function onPrefsEmailAudit( $user, $oldaddr, $newaddr ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"PrefsEmailAudit": "MyExtensionHooks::onPrefsEmailAudit"
	}
}

For MediaWiki ≤1.25:

$wgHooks['PrefsEmailAudit'][] = 'MyExtensionHooks::onPrefsEmailAudit';
Called from:File(s): SpecialChangeEmail.php

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

Details[edit]

  • $user: User (object) changing his email address
  • $oldaddr: old email address (string)
  • $newaddr: new email address (string)

Note that the new email addess is not confirmed at this point.

See also[edit]