Pass the user as an argument to 'isValidPassword' hook callbacks; see docs/hooks...
authorRob Church <robchurch@users.mediawiki.org>
Tue, 17 Jul 2007 22:30:52 +0000 (22:30 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 17 Jul 2007 22:30:52 +0000 (22:30 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/User.php

index 2259241..b607d29 100644 (file)
@@ -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 ==
 
index 9ad6b9f..fe1044e 100644 (file)
@@ -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.
index 22443fa..838b67e 100644 (file)
@@ -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;