Index: trunk/phase3/includes/api/ApiLogin.php |
— | — | @@ -68,8 +68,8 @@ |
69 | 69 | wfSetupSession(); |
70 | 70 | } |
71 | 71 | |
72 | | - $loginForm = new Login( $req ); |
73 | | - switch ( $authRes = $loginForm->attemptLogin() ) { |
| 72 | + $login = new Login( $req ); |
| 73 | + switch ( $authRes = $login->attemptLogin() ) { |
74 | 74 | case Login::SUCCESS : |
75 | 75 | global $wgUser, $wgCookiePrefix; |
76 | 76 | |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -540,6 +540,16 @@ |
541 | 541 | return; |
542 | 542 | } |
543 | 543 | } |
| 544 | + |
| 545 | + /** |
| 546 | + * Add text to the header. Only write to $mFormHeader directly |
| 547 | + * if you're determined to overwrite anything that other |
| 548 | + * extensions might have added. |
| 549 | + * @param $text String HTML |
| 550 | + */ |
| 551 | + public function addFormHeader( $text ){ |
| 552 | + $this->mFormHeader .= $text; |
| 553 | + } |
544 | 554 | |
545 | 555 | /** |
546 | 556 | * Since the UserLoginForm hook was changed to pass a SpecialPage |
Index: trunk/phase3/includes/specials/SpecialCreateAccount.php |
— | — | @@ -503,6 +503,16 @@ |
504 | 504 | } |
505 | 505 | |
506 | 506 | /** |
| 507 | + * Add text to the header. Only write to $mFormHeader directly |
| 508 | + * if you're determined to overwrite anything that other |
| 509 | + * extensions might have added. |
| 510 | + * @param $text String HTML |
| 511 | + */ |
| 512 | + public function addFormHeader( $text ){ |
| 513 | + $this->mFormHeader .= $text; |
| 514 | + } |
| 515 | + |
| 516 | + /** |
507 | 517 | * Since the UserCreateForm hook was changed to pass a SpecialPage |
508 | 518 | * instead of a QuickTemplate derivative, old extensions might |
509 | 519 | * easily try calling these methods expecing them to exist. Tempting |
Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php |
— | — | @@ -151,11 +151,12 @@ |
152 | 152 | wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" ); |
153 | 153 | return true; |
154 | 154 | } |
155 | | - $sp->mFormHeader .= |
| 155 | + $sp->addFormHeader( |
156 | 156 | "<div class='captcha'>" . |
157 | 157 | $wgOut->parse( $this->getMessage( 'createaccount' ) ) . |
158 | 158 | $this->getForm() . |
159 | | - "</div>\n"; |
| 159 | + "</div>\n" |
| 160 | + ); |
160 | 161 | } |
161 | 162 | return true; |
162 | 163 | } |
— | — | @@ -169,11 +170,12 @@ |
170 | 171 | function injectUserLogin( &$sp ) { |
171 | 172 | if ( $this->isBadLoginTriggered() ) { |
172 | 173 | global $wgOut; |
173 | | - $sp->mFormHeader .= |
| 174 | + $sp->addFormHeader( |
174 | 175 | "<div class='captcha'>" . |
175 | 176 | $wgOut->parse( $this->getMessage( 'badlogin' ) ) . |
176 | 177 | $this->getForm() . |
177 | | - "</div>\n"; |
| 178 | + "</div>\n" |
| 179 | + ); |
178 | 180 | } |
179 | 181 | return true; |
180 | 182 | } |
Index: trunk/extensions/WikimediaIncubator/CreateAccountTestWiki.php |
— | — | @@ -9,9 +9,9 @@ |
10 | 10 | $projectvalue = strtolower( $wgRequest->getVal( 'testwikiproject', '' ) ); |
11 | 11 | $codevalue = strtolower( $wgRequest->getVal( 'testwikicode', '' ) ); |
12 | 12 | if ( preg_match( '/[a-z][a-z][a-z]?/', $codevalue ) && in_array( $projectvalue, array( 'p', 'b', 't', 'q', 'n' ) ) ) { |
13 | | - $sp->mFormHeader .= '<input type="hidden" name="testwiki-project" value="' . $projectvalue . '" /> |
| 13 | + $sp->addFormHeader( '<input type="hidden" name="testwiki-project" value="' . $projectvalue . '" /> |
14 | 14 | <input type="hidden" name="testwiki-code" value="' . $codevalue . '" /> |
15 | | - '; |
| 15 | + '); |
16 | 16 | } |
17 | 17 | return true; |
18 | 18 | } |
Index: trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | wfLoadExtensionMessages( 'ConfirmAccount' ); |
139 | 139 | # Add a link to RequestAccount from UserLogin |
140 | 140 | if ( !$wgUser->isAllowed( 'createaccount' ) ) { |
141 | | - $sp->mFormHeader = wfMsgExt( 'requestaccount-loginnotice', array( 'parse' ) ); |
| 141 | + $sp->addFormHeader( wfMsgExt( 'requestaccount-loginnotice', array( 'parse' ) ) ); |
142 | 142 | } |
143 | 143 | return true; |
144 | 144 | } |