Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -451,7 +451,7 @@ |
452 | 452 | 'wrongpasswordempty', |
453 | 453 | 'passwordtooshort', |
454 | 454 | 'password-name-match', |
455 | | - 'password-too-weak', |
| 455 | + 'password-login-forbidden', |
456 | 456 | 'mailmypassword', |
457 | 457 | 'passwordremindertitle', |
458 | 458 | 'passwordremindertext', |
Index: trunk/phase3/includes/User.php |
— | — | @@ -602,22 +602,25 @@ |
603 | 603 | * @return mixed: true on success, string of error message on failure |
604 | 604 | */ |
605 | 605 | function getPasswordValidity( $password ) { |
606 | | - global $wgMinimalPasswordLength, $wgWeakPasswords, $wgContLang; |
| 606 | + global $wgMinimalPasswordLength, $wgContLang; |
| 607 | + |
| 608 | + static $blockedLogins = array( |
| 609 | + 'Useruser' => 'Passpass', 'Useruser1' => 'Passpass1', # r75589 |
| 610 | + 'Apitestsysop' => 'testpass', 'Apitestuser' => 'testpass' # r75605 |
| 611 | + ); |
607 | 612 | |
608 | 613 | $result = false; //init $result to false for the internal checks |
609 | 614 | |
610 | 615 | if( !wfRunHooks( 'isValidPassword', array( $password, &$result, $this ) ) ) |
611 | 616 | return $result; |
612 | 617 | |
613 | | - $lcPassword = $wgContLang->lc( $password ); |
614 | | - |
615 | 618 | if ( $result === false ) { |
616 | 619 | if( strlen( $password ) < $wgMinimalPasswordLength ) { |
617 | 620 | return 'passwordtooshort'; |
618 | | - } elseif ( $lcPassword == $wgContLang->lc( $this->mName ) ) { |
| 621 | + } elseif ( $wgContLang->lc( $password ) == $wgContLang->lc( $this->mName ) ) { |
619 | 622 | return 'password-name-match'; |
620 | | - } elseif ( in_array( $lcPassword, $wgWeakPasswords ) ) { |
621 | | - return 'password-too-weak'; |
| 623 | + } elseif ( isset( $blockedLogins[ $this->getName() ] ) && $password == $blockedLogins[ $this->getName() ] ) { |
| 624 | + return 'password-login-forbidden'; |
622 | 625 | } else { |
623 | 626 | //it seems weird returning true here, but this is because of the |
624 | 627 | //initialization of $result to false above. If the hook is never run or it |
— | — | @@ -2778,6 +2781,15 @@ |
2779 | 2782 | global $wgAuth; |
2780 | 2783 | $this->load(); |
2781 | 2784 | |
| 2785 | + // Even though we stop people from creating passwords that |
| 2786 | + // are shorter than this, doesn't mean people wont be able |
| 2787 | + // to. Certain authentication plugins do NOT want to save |
| 2788 | + // domain passwords in a mysql database, so we should |
| 2789 | + // check this (in case $wgAuth->strict() is false). |
| 2790 | + if( !$this->isValidPassword( $password ) ) { |
| 2791 | + return false; |
| 2792 | + } |
| 2793 | + |
2782 | 2794 | if( $wgAuth->authenticate( $this->getName(), $password ) ) { |
2783 | 2795 | return true; |
2784 | 2796 | } elseif( $wgAuth->strict() ) { |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2883,12 +2883,6 @@ |
2884 | 2884 | $wgLivePasswordStrengthChecks = false; |
2885 | 2885 | |
2886 | 2886 | /** |
2887 | | - * List of weak passwords which shouldn't be allowed. |
2888 | | - * The items should be in lowercase. The check is case insensitive. |
2889 | | - */ |
2890 | | -$wgWeakPasswords = array( 'password', 'passpass', 'passpass1' ); |
2891 | | - |
2892 | | -/** |
2893 | 2887 | * Maximum number of Unicode characters in signature |
2894 | 2888 | */ |
2895 | 2889 | $wgMaxSigChars = 255; |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1094,7 +1094,7 @@ |
1095 | 1095 | Please try again.', |
1096 | 1096 | 'passwordtooshort' => 'Passwords must be at least {{PLURAL:$1|1 character|$1 characters}}.', |
1097 | 1097 | 'password-name-match' => 'Your password must be different from your username.', |
1098 | | -'password-too-weak' => 'The provided password is too weak and cannot be used.', |
| 1098 | +'password-login-forbidden' => 'The use of these username and password has been forbidden.', |
1099 | 1099 | 'mailmypassword' => 'E-mail new password', |
1100 | 1100 | 'passwordremindertitle' => 'New temporary password for {{SITENAME}}', |
1101 | 1101 | 'passwordremindertext' => 'Someone (probably you, from IP address $1) requested a new |