Manual:Hooks/UserCryptPassword

Category:MediaWiki hooks#UserCryptPassword Category:Hooks added in MediaWiki 1.14.0#UserCryptPassword Category:MediaWiki deprecated or obsolete features#UserCryptPassword Category:Hooks removed in MediaWiki 1.24.0#UserCryptPassword
UserCryptPassword
Available from version 1.14.0 (r44815, CodeReview archive)
Removed in version 1.24.0Category:Removed hooks#UserCryptPassword
Was called when hashing a password.
Define function:
public static function onUserCryptPassword( &$password, &$salt, &$wgPasswordSalt, &$hash ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserCryptPassword": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserCryptPassword"
	}
}
Called from: File(s): User.phpCategory:MediaWiki hooks included in User.php#UserCryptPassword
Function(s): crypt
Interface: UserCryptPasswordHook.php

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

Details

This hook was removed in Gerrit change 77645 as part of the RFC for improving the storage of passwords.

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
Category:Hooks added in MediaWiki 1.14.0 Category:Hooks removed in MediaWiki 1.24.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in User.php Category:Removed hooks