[Mediawiki-l] Stronger Passwords code example and help (1.7.1)
joshua seagroves
joshua_seagroves at hotmail.com
Fri Dec 15 16:24:36 UTC 2006
Ok, I have this to require stronger passwords but when a user changes the password it does not enforce the rule. Works fine when creating the password but after that, well broken.Look at what i have pasted below and let em know where I screwed up.I have modified User.php to include this and also SpecialPreferences.php. This is with MW 1.7.1User.php:function isValidPassword( $password ) { global $wgMinimalPasswordLength, $wgBadPassword; if(strlen($password) <= $wgMinimalPasswordLength ) { $wgBadPassword = BP_TOOSHORT; return false; } if(!preg_match('/[0-9]/', $password) ) { $wgBadPassword = BP_NODIGIT; return false; } if(!preg_match('/[A-Z]/', $password) ) { $wgBadPassword = BP_NOUPPERCASE; return false; } if(!preg_match('/[a-z]/', $password) ) { $wgBadPassword = BP_NOLOWERCASE; return false; } $wgBadPassword = BP_NOERROR; return true;SpecialPreferences.php: if ( strlen( $this->mNewpass ) < $wgMinimalPasswordLength ) { Changed to something like this: if ( !$wgUser->isValidPassword( $this->mNewpass) {
_________________________________________________________________
All-in-one security and maintenance for your PC. Get a free 90-day trial!
http://www.windowsonecare.com/purchase/trial.aspx?sc_cid=wl_wlmail
More information about the MediaWiki-l
mailing list