Index: trunk/phase3/includes/specials/SpecialCreateAccount.php |
— | — | @@ -52,6 +52,7 @@ |
53 | 53 | 'id' => 'wpRealName', |
54 | 54 | 'tabindex' => '1', |
55 | 55 | 'size' => '20', |
| 56 | + 'help-message' => 'prefs-help-realname', |
56 | 57 | ), |
57 | 58 | 'Remember' => array( |
58 | 59 | 'type' => 'check', |
— | — | @@ -70,7 +71,6 @@ |
71 | 72 | public function __construct(){ |
72 | 73 | parent::__construct( 'CreateAccount', 'createaccount' ); |
73 | 74 | $this->mLogin = new Login(); |
74 | | - $this->mFormFields['RealName']['help'] = wfMsg( 'prefs-help-realname' ); |
75 | 75 | } |
76 | 76 | |
77 | 77 | public function execute( $par ){ |
— | — | @@ -82,25 +82,24 @@ |
83 | 83 | # Block signup here if in readonly. Keeps user from |
84 | 84 | # going through the process (filling out data, etc) |
85 | 85 | # and being informed later. |
86 | | - if ( wfReadOnly() ) { |
| 86 | + if( wfReadOnly() ) { |
87 | 87 | $wgOut->readOnlyPage(); |
88 | 88 | return; |
89 | 89 | } |
90 | 90 | # Bail out straightaway on permissions errors |
91 | | - if ( !$this->userCanExecute( $wgUser ) ) { |
| 91 | + if( !$this->userCanExecute( $wgUser ) ) { |
92 | 92 | $this->displayRestrictionError(); |
93 | 93 | return; |
94 | | - } elseif ( $wgUser->isBlockedFromCreateAccount() ) { |
| 94 | + } elseif( $wgUser->isBlockedFromCreateAccount() ) { |
95 | 95 | $this->userBlockedMessage(); |
96 | 96 | return; |
97 | | - } elseif ( count( $permErrors = $this->getTitle()->getUserPermissionsErrors( 'createaccount', $wgUser, true ) )>0 ) { |
98 | | - var_dump('error'); |
| 97 | + } elseif( count( $permErrors = $this->getTitle()->getUserPermissionsErrors( 'createaccount', $wgUser, true ) )>0 ) { |
99 | 98 | $wgOut->showPermissionsErrorPage( $permErrors, 'createaccount' ); |
100 | 99 | return; |
101 | 100 | } |
102 | 101 | |
103 | 102 | if( $this->mPosted ) { |
104 | | - if ( $this->mCreateaccountMail ) { |
| 103 | + if( $this->mCreateaccountMail ) { |
105 | 104 | return $this->addNewAccountMailPassword(); |
106 | 105 | } else { |
107 | 106 | return $this->addNewAccount(); |
— | — | @@ -251,7 +250,7 @@ |
252 | 251 | $wgOut->setPageTitle( wfMsgHtml( 'accountcreated' ) ); |
253 | 252 | $wgOut->setArticleRelated( false ); |
254 | 253 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
255 | | - $wgOut->addHTML( wfMsgWikiHtml( 'accountcreatedtext', $user->getName() ) ); |
| 254 | + $wgOut->addWikiMsg( 'accountcreatedtext', $user->getName() ); |
256 | 255 | $wgOut->returnToMain( false, $self ); |
257 | 256 | wfRunHooks( 'AddNewAccount', array( $user ) ); |
258 | 257 | $user->addNewUserLogEntry(); |
— | — | @@ -282,7 +281,7 @@ |
283 | 282 | # cation server before they create an account (otherwise, they can |
284 | 283 | # create a local account and login as any domain user). We only need |
285 | 284 | # to check this for domains that aren't local. |
286 | | - if( !in_array( $this->mDomain, array( 'local', '' ) ) |
| 285 | + if( !in_array( $this->mDomain, array( 'local', '' ) ) |
287 | 286 | && !$wgAuth->canCreateAccounts() |
288 | 287 | && ( !$wgAuth->userExists( $this->mUsername ) |
289 | 288 | || !$wgAuth->authenticate( $this->mUsername, $this->mPassword ) |
— | — | @@ -293,7 +292,7 @@ |
294 | 293 | } |
295 | 294 | |
296 | 295 | $ip = wfGetIP(); |
297 | | - if ( $wgEnableSorbs && !in_array( $ip, $wgProxyWhitelist ) && |
| 296 | + if( $wgEnableSorbs && !in_array( $ip, $wgProxyWhitelist ) && |
298 | 297 | $wgUser->inSorbsBlacklist( $ip ) ) |
299 | 298 | { |
300 | 299 | $this->showMainForm( wfMsg( 'sorbs_create_account_reason' ) . ' (' . htmlspecialchars( $ip ) . ')' ); |
— | — | @@ -303,24 +302,24 @@ |
304 | 303 | # Now create a dummy user ($user) and check if it is valid |
305 | 304 | $name = trim( $this->mUsername ); |
306 | 305 | $user = User::newFromName( $name, 'creatable' ); |
307 | | - if ( is_null( $user ) ) { |
| 306 | + if( is_null( $user ) ) { |
308 | 307 | $this->showMainForm( wfMsg( 'noname' ) ); |
309 | 308 | return false; |
310 | 309 | } |
311 | 310 | |
312 | | - if ( 0 != $user->idForName() ) { |
| 311 | + if( 0 != $user->idForName() ) { |
313 | 312 | $this->showMainForm( wfMsg( 'userexists' ) ); |
314 | 313 | return false; |
315 | 314 | } |
316 | 315 | |
317 | | - if ( 0 != strcmp( $this->mPassword, $this->mRetype ) ) { |
| 316 | + if( 0 != strcmp( $this->mPassword, $this->mRetype ) ) { |
318 | 317 | $this->showMainForm( wfMsg( 'badretype' ) ); |
319 | 318 | return false; |
320 | 319 | } |
321 | 320 | |
322 | 321 | # check for minimal password length |
323 | 322 | $valid = $user->isValidPassword( $this->mPassword ); |
324 | | - if ( $valid !== true ) { |
| 323 | + if( $valid !== true ) { |
325 | 324 | if ( !$this->mCreateaccountMail ) { |
326 | 325 | $this->showMainForm( wfMsgExt( $valid, array( 'parsemag' ), $wgMinimalPasswordLength ) ); |
327 | 326 | return false; |
— | — | @@ -333,7 +332,7 @@ |
334 | 333 | |
335 | 334 | # if you need a confirmed email address to edit, then obviously you |
336 | 335 | # need an email address. |
337 | | - if ( $wgEmailConfirmToEdit && empty( $this->mEmail ) ) { |
| 336 | + if( $wgEmailConfirmToEdit && empty( $this->mEmail ) ) { |
338 | 337 | $this->showMainForm( wfMsg( 'noemailtitle' ) ); |
339 | 338 | return false; |
340 | 339 | } |
— | — | @@ -356,13 +355,13 @@ |
357 | 356 | return false; |
358 | 357 | } |
359 | 358 | |
360 | | - if ( $wgAccountCreationThrottle && $wgUser->isPingLimitable() ) { |
| 359 | + if( $wgAccountCreationThrottle && $wgUser->isPingLimitable() ) { |
361 | 360 | $key = wfMemcKey( 'acctcreate', 'ip', $ip ); |
362 | 361 | $value = $wgMemc->get( $key ); |
363 | 362 | if ( !$value ) { |
364 | 363 | $wgMemc->set( $key, 0, 86400 ); |
365 | 364 | } |
366 | | - if ( $value >= $wgAccountCreationThrottle ) { |
| 365 | + if( $value >= $wgAccountCreationThrottle ) { |
367 | 366 | $this->showMainForm( wfMsgExt( 'acct_creation_throttle_hit', array( 'parseinline' ), $wgAccountCreationThrottle ) ); |
368 | 367 | return false; |
369 | 368 | } |
— | — | @@ -418,8 +417,8 @@ |
419 | 418 | $blocker = User::whoIs( $wgUser->mBlock->mBy ); |
420 | 419 | $block_reason = $wgUser->mBlock->mReason; |
421 | 420 | |
422 | | - if ( strval( $block_reason ) === '' ) { |
423 | | - $block_reason = wfMsg( 'blockednoreason' ); |
| 421 | + if( strval( $block_reason ) === '' ) { |
| 422 | + $block_reason = wfMsgExt( 'blockednoreason' ); |
424 | 423 | } |
425 | 424 | $wgOut->addWikiMsg( 'cantcreateaccount-text', $ip, $block_reason, $blocker ); |
426 | 425 | $wgOut->returnToMain( false ); |
— | — | @@ -514,10 +513,10 @@ |
515 | 514 | unset( $this->mFormFields['Email'] ); |
516 | 515 | } else { |
517 | 516 | if( $wgEmailConfirmToEdit ){ |
518 | | - $this->mFormFields['Email']['help'] = wfMsg( 'prefs-help-email-required' ); |
| 517 | + $this->mFormFields['Email']['help-message'] = 'prefs-help-email-required' ; |
519 | 518 | $this->mFormFields['Email']['required'] = ''; |
520 | 519 | } else { |
521 | | - $this->mFormFields['Email']['help'] = wfMsg( 'prefs-help-email' ); |
| 520 | + $this->mFormFields['Email']['help-message'] = 'prefs-help-email'; |
522 | 521 | } |
523 | 522 | } |
524 | 523 | |
— | — | @@ -551,8 +550,8 @@ |
552 | 551 | . $form->getBody() |
553 | 552 | . $form->getButtons() |
554 | 553 | . $buttons |
555 | | - . Xml::hidden( 'returnto', $this->mReturnTo ) |
556 | | - . Xml::hidden( 'returntoquery', $this->mReturnToQuery ) |
| 554 | + . Html::hidden( 'returnto', $this->mReturnTo ) |
| 555 | + . Html::hidden( 'returntoquery', $this->mReturnToQuery ) |
557 | 556 | ; |
558 | 557 | |
559 | 558 | $wgOut->setPageTitle( wfMsg( 'createaccount' ) ); |