Author: mediawiki
Description:
I'd like a hook in User->isValidPassword, to enable the enforcement of strong passwords.
Here's the diff..
- mediawiki-1.9.3/includes/User.php 2007-02-21 03:20:31.000000000 +0100
+++ wiki/includes/User.php 2007-03-06 07:43:15.000000000 +0100
@@ -466,7 +466,17 @@
*/ static function isValidPassword( $password ) { global $wgMinimalPasswordLength;
- return strlen( $password ) >= $wgMinimalPasswordLength;
+ if (strlen( $password ) >= $wgMinimalPasswordLength) {
+ call hook
+ if( !wfRunHooks( 'EnforceStrongPassword', array( $password ) ) ) {
+ return false;
+ }
+ return true;
+ }
+ else {
+ password is false, no need to bother with the hook.
+ return false;
+ }
} /**
Many thanks!
Ger Apeldoorn
Version: 1.9.x
Severity: enhancement