From 396524f67413c69576cd84b3c29cfc1045c05718 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 17 Jul 2007 22:30:52 +0000 Subject: [PATCH] Pass the user as an argument to 'isValidPassword' hook callbacks; see docs/hooks.txt for more information --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 1 + includes/User.php | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 22592417df..b607d29afe 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -150,6 +150,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN phisticated handheld browser. * (bug 3173) Option to offer exported pages as a download, rather than displaying inline, as in most browsers +* Pass the user as an argument to 'isValidPassword' hook callbacks; see + docs/hooks.txt for more information == Bugfixes since 1.10 == diff --git a/docs/hooks.txt b/docs/hooks.txt index 9ad6b9f4c8..fe1044e9c9 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -467,6 +467,7 @@ after noinclude/includeonly/onlyinclude and other processing. 'isValidPassword': Override the result of User::isValidPassword() $password: Desired password &$result: Set this and return false to override the internal checks +$user: User the password is being validated for 'LoginAuthenticateAudit': a login attempt for a valid user account either succeeded or failed. No return data is accepted; this hook is for auditing only. diff --git a/includes/User.php b/includes/User.php index 22443fabde..838b67ef2e 100644 --- a/includes/User.php +++ b/includes/User.php @@ -490,7 +490,7 @@ class User { global $wgMinimalPasswordLength, $wgContLang; $result = null; - if( !wfRunHooks( 'isValidPassword', array( $password, &$result ) ) ) + if( !wfRunHooks( 'isValidPassword', array( $password, &$result, $this ) ) ) return $result; if( $result === false ) return false; -- 2.20.1