Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -481,6 +481,7 @@ |
482 | 482 | 'createaccount-text', |
483 | 483 | 'usernamehasherror', |
484 | 484 | 'login-throttled', |
| 485 | + 'login-abort-generic', |
485 | 486 | 'loginlanguagelabel', |
486 | 487 | 'loginlanguagelinks', |
487 | 488 | 'suspicious-userlogout', |
Index: trunk/phase3/includes/api/ApiLogin.php |
— | — | @@ -140,6 +140,11 @@ |
141 | 141 | $result['result'] = 'Blocked'; |
142 | 142 | break; |
143 | 143 | |
| 144 | + case LoginForm::ABORTED: |
| 145 | + $result['result'] = 'Aborted'; |
| 146 | + $result['reason'] = $this->mAbortLoginErrorMsg; |
| 147 | + break; |
| 148 | + |
144 | 149 | default: |
145 | 150 | ApiBase::dieDebug( __METHOD__, "Unhandled case value: {$authRes}" ); |
146 | 151 | } |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | var $mAction, $mCreateaccount, $mCreateaccountMail, $mMailmypassword; |
49 | 49 | var $mLoginattempt, $mRemember, $mEmail, $mDomain, $mLanguage; |
50 | 50 | var $mSkipCookieCheck, $mReturnToQuery, $mToken, $mStickHTTPS; |
| 51 | + var $mAbortLoginErrorMsg = 'login-abort-generic'; |
51 | 52 | |
52 | 53 | private $mExtUser = null; |
53 | 54 | |
— | — | @@ -527,7 +528,7 @@ |
528 | 529 | |
529 | 530 | // Give general extensions, such as a captcha, a chance to abort logins |
530 | 531 | $abort = self::ABORTED; |
531 | | - if( !wfRunHooks( 'AbortLogin', array( $u, $this->mPassword, &$abort ) ) ) { |
| 532 | + if( !wfRunHooks( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$this->mAbortLoginErrorMsg ) ) ) { |
532 | 533 | return $abort; |
533 | 534 | } |
534 | 535 | |
— | — | @@ -707,6 +708,9 @@ |
708 | 709 | $this->mainLoginForm( wfMsgExt( 'login-userblocked', |
709 | 710 | array( 'parsemag', 'escape' ), $this->mUsername ) ); |
710 | 711 | break; |
| 712 | + case self::ABORTED: |
| 713 | + $this->mainLoginForm( wfMsg( $this->mAbortLoginErrorMsg ) ); |
| 714 | + break; |
711 | 715 | default: |
712 | 716 | throw new MWException( 'Unhandled case value' ); |
713 | 717 | } |
Index: trunk/phase3/languages/messages/MessagesQqq.php |
— | — | @@ -720,6 +720,7 @@ |
721 | 721 | *Parameter $3 is a password (randomly generated). |
722 | 722 | *Parameter $4 is a URL to the wiki', |
723 | 723 | 'login-throttled' => 'Error message shown at [[Special:UserLogin]] after 5 wrong passwords. The hardcoded waiting time is 300 seconds.', |
| 724 | +'login-abort-generic' => 'The generic unsuccessful login message used unless otherwise specified by hook writers', |
724 | 725 | |
725 | 726 | # JavaScript password checks |
726 | 727 | 'password-strength' => 'Indicator of [[w:Password strength|password strength]] shown when entering a new password (during user registration or password reset). |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1153,6 +1153,7 @@ |
1154 | 1154 | 'usernamehasherror' => 'Username cannot contain hash characters', |
1155 | 1155 | 'login-throttled' => 'You have made too many recent login attempts. |
1156 | 1156 | Please wait before trying again.', |
| 1157 | +'login-abort-generic' => 'Your login was unsuccessful - Aborted', |
1157 | 1158 | 'loginlanguagelabel' => 'Language: $1', |
1158 | 1159 | 'loginlanguagelinks' => '* Deutsch|de |
1159 | 1160 | * English|en |