Index: trunk/extensions/CentralAuth/SpecialCentralAuth.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | class SpecialCentralAuth extends SpecialPage { |
5 | 4 | var $mUserName, $mCanUnmerge, $mCanLock, $mCanOversight, $mCanEdit; |
6 | 5 | var $mGlobalUser, $mAttachedLocalAccounts, $mUnattachedLocalAccounts; |
— | — | @@ -82,7 +81,7 @@ |
83 | 82 | $this->showWikiLists(); |
84 | 83 | } |
85 | 84 | } |
86 | | - |
| 85 | + |
87 | 86 | /** Returns true if the normal form should be displayed */ |
88 | 87 | function doSubmit() { |
89 | 88 | $deleted = false; |
— | — | @@ -142,7 +141,7 @@ |
143 | 142 | } elseif( $reasonDetail ) { |
144 | 143 | $reason .= wfMsgForContent( 'colon-separator' ) . $reasonDetail; |
145 | 144 | } |
146 | | - |
| 145 | + |
147 | 146 | if ( $oldHiddenLevel != $setHidden ) { |
148 | 147 | $hideStatus = $globalUser->adminSetHidden( $setHidden ); |
149 | 148 | switch( $setHidden ) { |
— | — | @@ -168,11 +167,11 @@ |
169 | 168 | elseif( $oldHiddenLevel == CentralAuthUser::HIDDEN_OVERSIGHT ) |
170 | 169 | $globalUser->unsuppress( $reason ); |
171 | 170 | } |
172 | | - |
| 171 | + |
173 | 172 | $good = |
174 | 173 | ( is_null($lockStatus) || $lockStatus->isGood() ) && |
175 | 174 | ( is_null($hideStatus) || $hideStatus->isGood() ); |
176 | | - |
| 175 | + |
177 | 176 | // Logging etc |
178 | 177 | if ( $good && (count($added) || count($removed)) ) { |
179 | 178 | $added = count($added) ? |
— | — | @@ -399,7 +398,7 @@ |
400 | 399 | $expiryd = $wgLang->date( $row['block-expiry'] ); |
401 | 400 | $expiryt = $wgLang->time( $row['block-expiry'] ); |
402 | 401 | $reason = $row['block-reason']; |
403 | | - |
| 402 | + |
404 | 403 | $text = wfMsgExt( 'centralauth-admin-blocked', 'parseinline', array( $expiry, $reason, $expiryd, $expiryt ) ); |
405 | 404 | } |
406 | 405 | } else { |
— | — | @@ -473,7 +472,7 @@ |
474 | 473 | 'User:' . $this->mUserName, |
475 | 474 | $wikiname, |
476 | 475 | wfMsg( 'centralauth-foreign-link', $this->mUserName, $wikiname ) ); |
477 | | - |
| 476 | + |
478 | 477 | } |
479 | 478 | |
480 | 479 | function adminCheck( $wikiID ) { |
— | — | @@ -499,7 +498,7 @@ |
500 | 499 | ) . |
501 | 500 | '</form></fieldset>' ); |
502 | 501 | } |
503 | | - |
| 502 | + |
504 | 503 | function showStatusForm() { |
505 | 504 | // Allows locking, hiding, locking and hiding. |
506 | 505 | global $wgUser, $wgOut; |
— | — | @@ -508,49 +507,53 @@ |
509 | 508 | $form .= Xml::hidden( 'wpMethod', 'set-status' ); |
510 | 509 | $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken() ); |
511 | 510 | $form .= wfMsgExt( 'centralauth-admin-status-intro', 'parse' ); |
512 | | - |
| 511 | + |
513 | 512 | // Radio buttons |
514 | 513 | $radioLocked = |
515 | 514 | Xml::radioLabel( |
516 | | - wfMsg( 'centralauth-admin-status-locked-no' ), |
| 515 | + wfMsgExt( 'centralauth-admin-status-locked-no', array( 'parseinline' ) ), |
517 | 516 | 'wpStatusLocked', |
518 | 517 | '0', |
519 | 518 | 'mw-centralauth-status-locked-no', |
520 | 519 | !$this->mGlobalUser->isLocked() ) . |
521 | 520 | '<br />' . |
522 | 521 | Xml::radioLabel( |
523 | | - wfMsg( 'centralauth-admin-status-locked-yes' ), |
| 522 | + wfMsgExt( 'centralauth-admin-status-locked-yes', array( 'parseinline' ) ), |
524 | 523 | 'wpStatusLocked', |
525 | 524 | '1', |
526 | 525 | 'mw-centralauth-status-locked-yes', |
527 | 526 | $this->mGlobalUser->isLocked() ); |
528 | 527 | $radioHidden = |
529 | 528 | Xml::radioLabel( |
530 | | - wfMsg( 'centralauth-admin-status-hidden-no' ), |
| 529 | + wfMsgExt( 'centralauth-admin-status-hidden-no', array( 'parseinline' ) ), |
531 | 530 | 'wpStatusHidden', |
532 | 531 | CentralAuthUser::HIDDEN_NONE, |
533 | 532 | 'mw-centralauth-status-hidden-no', |
534 | 533 | $this->mGlobalUser->getHiddenLevel() == CentralAuthUser::HIDDEN_NONE ) . |
535 | 534 | '<br />' . |
536 | 535 | Xml::radioLabel( |
537 | | - wfMsg( 'centralauth-admin-status-hidden-list' ), |
| 536 | + wfMsgExt( 'centralauth-admin-status-hidden-list', array( 'parseinline' ) ), |
538 | 537 | 'wpStatusHidden', |
539 | 538 | CentralAuthUser::HIDDEN_LISTS, |
540 | 539 | 'mw-centralauth-status-hidden-list', |
541 | 540 | $this->mGlobalUser->getHiddenLevel() == CentralAuthUser::HIDDEN_LISTS ) . |
542 | 541 | '<br />'; |
543 | | - if( $this->mCanOversight ) |
| 542 | + if( $this->mCanOversight ) { |
544 | 543 | $radioHidden .= Xml::radioLabel( |
545 | | - wfMsg( 'centralauth-admin-status-hidden-oversight' ), |
| 544 | + wfMsgExt( 'centralauth-admin-status-hidden-oversight', array( 'parseinline' ) ), |
546 | 545 | 'wpStatusHidden', |
547 | 546 | CentralAuthUser::HIDDEN_OVERSIGHT, |
548 | 547 | 'mw-centralauth-status-hidden-oversight', |
549 | | - $this->mGlobalUser->getHiddenLevel() == CentralAuthUser::HIDDEN_OVERSIGHT ); |
| 548 | + $this->mGlobalUser->getHiddenLevel() == CentralAuthUser::HIDDEN_OVERSIGHT |
| 549 | + ); |
| 550 | + } |
550 | 551 | |
551 | 552 | // Reason |
552 | | - $reasonList = Xml::listDropDown( 'wpReasonList', |
| 553 | + $reasonList = Xml::listDropDown( |
| 554 | + 'wpReasonList', |
553 | 555 | wfMsgForContent( 'centralauth-admin-status-reasons' ), |
554 | | - wfMsgForContent( 'ipbreasonotherlist' ) ); |
| 556 | + wfMsgForContent( 'ipbreasonotherlist' ) |
| 557 | + ); |
555 | 558 | $reasonField = Xml::input( 'wpReason', 45, false ); |
556 | 559 | |
557 | 560 | $form .= Xml::buildForm( |
— | — | @@ -559,18 +562,20 @@ |
560 | 563 | 'centralauth-admin-status-hidden' => $radioHidden, |
561 | 564 | 'centralauth-admin-reason' => $reasonList, |
562 | 565 | 'centralauth-admin-reason-other' => $reasonField ), |
563 | | - 'centralauth-admin-status-submit' ); |
| 566 | + 'centralauth-admin-status-submit' |
| 567 | + ); |
564 | 568 | |
565 | 569 | $form .= '</fieldset>'; |
566 | | - $form = Xml::tags( 'form', |
567 | | - array( 'method' => 'POST', |
568 | | - 'action' => |
569 | | - $this->getTitle()->getFullURL( |
570 | | - array( 'target' => $this->mUserName ) |
571 | | - ), |
572 | | - ), |
573 | | - $form |
574 | | - ); |
| 570 | + $form = Xml::tags( |
| 571 | + 'form', |
| 572 | + array( |
| 573 | + 'method' => 'POST', |
| 574 | + 'action' => $this->getTitle()->getFullURL( |
| 575 | + array( 'target' => $this->mUserName ) |
| 576 | + ), |
| 577 | + ), |
| 578 | + $form |
| 579 | + ); |
575 | 580 | $wgOut->addHTML( $form ); |
576 | 581 | } |
577 | 582 | |
— | — | @@ -622,7 +627,7 @@ |
623 | 628 | |
624 | 629 | function logAction( $action, $target, $reason = '', $params = array(), $suppressLog = false ) { |
625 | 630 | $logType = $suppressLog ? 'suppress' : 'globalauth'; // Not centralauth because of some weird length limitiations |
626 | | - $log = new LogPage( $logType ); |
| 631 | + $log = new LogPage( $logType ); |
627 | 632 | $log->addEntry( $action, Title::newFromText( "User:{$target}@global" ), $reason, $params ); |
628 | 633 | } |
629 | 634 | } |