Manual:Hooks/UserComparePasswords

Category:MediaWiki hooks#UserComparePasswords Category:Hooks added in MediaWiki 1.14.0#UserComparePasswords Category:MediaWiki deprecated or obsolete features#UserComparePasswords Category:Hooks removed in MediaWiki 1.24.0#UserComparePasswords
UserComparePasswords
Available from version 1.14.0 (r44815, CodeReview archive)
Removed in version 1.24.0Category:Removed hooks#UserComparePasswords
Called when checking passwords.
Define function:
public static function onUserComparePasswords( &$hash, &$password, &$userId, &$result ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserComparePasswords": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserComparePasswords"
	}
}
Called from: File(s): User.phpCategory:MediaWiki hooks included in User.php#UserComparePasswords
Interface: UserComparePasswordsHook.php

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

Details

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

Return false to override the default password checks.

  • &$hash: String of the password hash (from the database)
  • &$password: String of the plaintext password the user entered
  • &$userId: Integer of the user's ID or boolean false if the user ID was not supplied
  • &$result: If the hook returns false, this boolean value will be checked to determine if the password was valid
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