Manual:Hooks/UserCryptPassword

From MediaWiki.org
Jump to: navigation, search
UserCryptPassword
Available from version 1.14.0 (r44815)
Called when hashing a password.

*Define function:
function fnMyHook( &$password, &$salt, &$wgPasswordSalt, &$hash ) { ... }

*Attach hook:
$wgHooks['UserCryptPassword'][] = 'MyExtensionHooks::someExample';
Called from: User.php

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


[edit] Details

Return false to implement your own hashing method.

  • &$password: String of the plaintext password to encrypt
  • &$salt: String of the password salt or boolean false if no salt is provided
  • &$wgPasswordSalt: Boolean of whether the salt is used in the default hashing method
  • &$hash: If the hook returns false, this string will be used as the hash
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox