r107249 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107248‎ | r107249 | r107250 >
Date:00:02, 25 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Kill off $wgUser, $wgOut, $wgRequest in Api and specialpages
Modified paths:
  • /trunk/extensions/CentralAuth/ApiQueryGlobalUserInfo.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialAutoLogin.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialCentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialGlobalGroupMembership.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialGlobalGroupPermissions.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialGlobalUsers.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialMergeAccount.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialWikiSets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/ApiQueryGlobalUserInfo.php
@@ -34,12 +34,10 @@
3535 }
3636
3737 public function execute() {
38 - global $wgUser;
39 -
4038 $params = $this->extractRequestParams();
4139 $prop = array_flip( (array)$params['prop'] );
4240 if ( is_null( $params['user'] ) ) {
43 - $params['user'] = $wgUser->getName();
 41+ $params['user'] = $this->getUser()->getName();
4442 }
4543 $user = new CentralAuthUser( $params['user'] );
4644
Index: trunk/extensions/CentralAuth/specials/SpecialGlobalGroupMembership.php
@@ -11,8 +11,7 @@
1212 function __construct() {
1313 SpecialPage::__construct( 'GlobalGroupMembership' );
1414
15 - global $wgUser;
16 - $this->mGlobalUser = CentralAuthUser::getInstance( $wgUser );
 15+ $this->mGlobalUser = CentralAuthUser::getInstance( $this->getUser() );
1716 }
1817
1918 /**
@@ -28,9 +27,9 @@
2928 * Output a form to allow searching for a user
3029 */
3130 function switchForm() {
32 - global $wgOut, $wgScript, $wgRequest;
 31+ global $wgScript;
3332
34 - $knownwiki = $wgRequest->getVal( 'wpKnownWiki' );
 33+ $knownwiki = $this->getRequest()->getVal( 'wpKnownWiki' );
3534 $knownwiki = $knownwiki ? $knownwiki : wfWikiId();
3635
3736 // Generate wiki selector
@@ -40,8 +39,8 @@
4140 $selector->addOption( $wiki );
4241 }
4342
44 - $wgOut->addModuleStyles( 'mediawiki.special' );
45 - $wgOut->addHTML(
 43+ $this->getOutput()->addModuleStyles( 'mediawiki.special' );
 44+ $this->getOutput()->addHTML(
4645 Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1' ) ) .
4746 Html::hidden( 'title', $this->getTitle() ) .
4847 Xml::openElement( 'fieldset' ) .
@@ -80,15 +79,13 @@
8180 * @return Status
8281 */
8382 function fetchUser( $username ) {
84 - global $wgRequest;
 83+ $knownwiki = $this->getRequest()->getVal( 'wpKnownWiki' );
8584
86 - $knownwiki = $wgRequest->getVal( 'wpKnownWiki' );
87 -
8885 $user = CentralAuthGroupMembershipProxy::newFromName( $username );
8986
9087 if ( !$user ) {
9188 return Status::newFatal( 'nosuchusershort', $username );
92 - } elseif ( !$wgRequest->getCheck( 'saveusergroups' ) && !$user->attachedOn( $knownwiki ) ) {
 89+ } elseif ( !$this->getRequest()->getCheck( 'saveusergroups' ) && !$user->attachedOn( $knownwiki ) ) {
9390 return Status::newFatal( 'centralauth-globalgroupmembership-badknownwiki',
9491 $username, $knownwiki );
9592 }
Index: trunk/extensions/CentralAuth/specials/SpecialGlobalGroupPermissions.php
@@ -45,23 +45,21 @@
4646 }
4747
4848 function execute( $subpage ) {
49 - global $wgRequest, $wgOut, $wgUser;
50 -
51 - if ( !$this->userCanExecute( $wgUser ) ) {
 49+ if ( !$this->userCanExecute( $this->getUser() ) ) {
5250 $this->displayRestrictionError();
5351 return;
5452 }
5553
56 - $wgOut->setPageTitle( wfMsg( 'globalgrouppermissions' ) );
57 - $wgOut->setRobotPolicy( "noindex,nofollow" );
58 - $wgOut->setArticleRelated( false );
59 - $wgOut->enableClientCache( false );
 54+ $this->getOutput()->setPageTitle( wfMsg( 'globalgrouppermissions' ) );
 55+ $this->getOutput()->setRobotPolicy( "noindex,nofollow" );
 56+ $this->getOutput()->setArticleRelated( false );
 57+ $this->getOutput()->enableClientCache( false );
6058
6159 if ( $subpage == '' ) {
62 - $subpage = $wgRequest->getVal( 'wpGroup' );
 60+ $subpage = $this->getRequest()->getVal( 'wpGroup' );
6361 }
6462
65 - if ( $subpage != '' && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
 63+ if ( $subpage != '' && $this->getUser()->matchEditToken( $this->getRequest()->getVal( 'wpEditToken' ) ) ) {
6664 $this->doSubmit( $subpage );
6765 } elseif ( $subpage != '' ) {
6866 $this->buildGroupView( $subpage );
@@ -71,31 +69,31 @@
7270 }
7371
7472 function buildMainView() {
75 - global $wgOut, $wgUser, $wgScript;
 73+ global $wgScript;
7674
7775 $groups = CentralAuthUser::availableGlobalGroups();
7876
7977 // Existing groups
8078 $html = Xml::fieldset( wfMsg( 'centralauth-existinggroup-legend' ) );
8179
82 - $wgOut->addHTML( $html );
 80+ $this->getOutput()->addHTML( $html );
8381
8482 if ( count( $groups ) ) {
85 - $wgOut->addWikiMsg( 'centralauth-globalgroupperms-grouplist' );
86 - $wgOut->addHTML( '<ul>' );
 83+ $this->getOutput()->addWikiMsg( 'centralauth-globalgroupperms-grouplist' );
 84+ $this->getOutput()->addHTML( '<ul>' );
8785
8886 foreach ( $groups as $group ) {
8987 $text = wfMsgExt( 'centralauth-globalgroupperms-grouplistitem', array( 'parseinline' ), User::getGroupName( $group ), $group, '<span class="centralauth-globalgroupperms-groupname">' . $group . '</span>' );
9088
91 - $wgOut->addHTML( "<li> $text </li>" );
 89+ $this->getOutput()->addHTML( "<li> $text </li>" );
9290 }
9391 } else {
94 - $wgOut->addWikiMsg( 'centralauth-globalgroupperms-nogroups' );
 92+ $this->getOutput()->addWikiMsg( 'centralauth-globalgroupperms-nogroups' );
9593 }
9694
97 - $wgOut->addHTML( Xml::closeElement( 'ul' ) . Xml::closeElement( 'fieldset' ) );
 95+ $this->getOutput()->addHTML( Xml::closeElement( 'ul' ) . Xml::closeElement( 'fieldset' ) );
9896
99 - if ( $this->userCanEdit( $wgUser ) ) {
 97+ if ( $this->userCanEdit( $this->getUser() ) ) {
10098 // "Create a group" prompt
10199 $html = Xml::fieldset( wfMsg( 'centralauth-newgroup-legend' ) );
102100 $html .= wfMsgExt( 'centralauth-newgroup-intro', array( 'parse' ) );
@@ -108,7 +106,7 @@
109107 $html .= Xml::closeElement( 'form' );
110108 $html .= Xml::closeElement( 'fieldset' );
111109
112 - $wgOut->addHTML( $html );
 110+ $this->getOutput()->addHTML( $html );
113111 }
114112 }
115113
@@ -116,18 +114,16 @@
117115 * @param $group
118116 */
119117 function buildGroupView( $group ) {
120 - global $wgOut, $wgUser;
 118+ $editable = $this->userCanEdit( $this->getUser() );
121119
122 - $editable = $this->userCanEdit( $wgUser );
 120+ $this->getOutput()->setSubtitle( wfMsg( 'centralauth-editgroup-subtitle', $group ) );
123121
124 - $wgOut->setSubtitle( wfMsg( 'centralauth-editgroup-subtitle', $group ) );
125 -
126122 $html = Xml::fieldset( wfMsg( 'centralauth-editgroup-fieldset', $group ) );
127123
128124 if ( $editable ) {
129125 $html .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => SpecialPage::getTitleFor( 'GlobalGroupPermissions', $group )->getLocalUrl(), 'name' => 'centralauth-globalgroups-newgroup' ) );
130126 $html .= Html::hidden( 'wpGroup', $group );
131 - $html .= Html::hidden( 'wpEditToken', $wgUser->editToken() );
 127+ $html .= Html::hidden( 'wpEditToken', $this->getUser()->editToken() );
132128 }
133129
134130 $fields = array();
@@ -150,9 +146,9 @@
151147
152148 $html .= Xml::closeElement( 'fieldset' );
153149
154 - $wgOut->addHTML( $html );
 150+ $this->getOutput()->addHTML( $html );
155151
156 - $this->showLogFragment( $group, $wgOut );
 152+ $this->showLogFragment( $group, $this->getOutput() );
157153 }
158154
159155 /**
@@ -163,8 +159,7 @@
164160 $sets = WikiSet::getAllWikiSets();
165161 $default = WikiSet::getWikiSetForGroup( $group );
166162
167 - global $wgUser;
168 - if ( !$this->userCanEdit( $wgUser ) )
 163+ if ( !$this->userCanEdit( $this->getUser() ) )
169164 return htmlspecialchars( $default );
170165
171166 $select = new XmlSelect( 'set', 'wikiset', $default );
@@ -182,10 +177,8 @@
183178 * @return string
184179 */
185180 function buildCheckboxes( $group ) {
186 - global $wgUser, $wgOut;
 181+ $editable = $this->userCanEdit( $this->getUser() );
187182
188 - $editable = $this->userCanEdit( $wgUser );
189 -
190183 $rights = User::getAllRights();
191184 $assignedRights = $this->getAssignedRights( $group );
192185
@@ -202,7 +195,7 @@
203196 # Build a checkbox.
204197 $checked = in_array( $right, $assignedRights );
205198
206 - $desc = $wgOut->parseInline( User::getRightDescription( $right ) ) . ' ' .
 199+ $desc = $this->getOutput()->parseInline( User::getRightDescription( $right ) ) . ' ' .
207200 Xml::element( 'tt', null, wfMsg( 'parentheses', $right ) );
208201
209202 $checkbox = Xml::check( "wpRightAssigned-$right", $checked,
@@ -246,10 +239,8 @@
247240 }
248241
249242 function doSubmit( $group ) {
250 - global $wgRequest, $wgOut, $wgUser;
251 -
252243 // Paranoia -- the edit token shouldn't match anyway
253 - if ( !$this->userCanEdit( $wgUser ) )
 244+ if ( !$this->userCanEdit( $this->getUser() ) )
254245 return;
255246
256247 $newRights = array();
@@ -258,18 +249,18 @@
259250 $oldRights = $this->getAssignedRights( $group );
260251 $allRights = User::getAllRights();
261252
262 - $reason = $wgRequest->getVal( 'wpReason', '' );
 253+ $reason = $this->getRequest()->getVal( 'wpReason', '' );
263254
264255 foreach ( $allRights as $right ) {
265256 $alreadyAssigned = in_array( $right, $oldRights );
266257
267 - if ( $wgRequest->getCheck( "wpRightAssigned-$right" ) ) {
 258+ if ( $this->getRequest()->getCheck( "wpRightAssigned-$right" ) ) {
268259 $newRights[] = $right;
269260 }
270261
271 - if ( !$alreadyAssigned && $wgRequest->getCheck( "wpRightAssigned-$right" ) ) {
 262+ if ( !$alreadyAssigned && $this->getRequest()->getCheck( "wpRightAssigned-$right" ) ) {
272263 $addRights[] = $right;
273 - } elseif ( $alreadyAssigned && !$wgRequest->getCheck( "wpRightAssigned-$right" ) ) {
 264+ } elseif ( $alreadyAssigned && !$this->getRequest()->getCheck( "wpRightAssigned-$right" ) ) {
274265 $removeRights[] = $right;
275266 } # Otherwise, do nothing.
276267 }
@@ -286,7 +277,7 @@
287278
288279 // Change set
289280 $current = WikiSet::getWikiSetForGroup( $group );
290 - $new = $wgRequest->getVal( 'set' );
 281+ $new = $this->getRequest()->getVal( 'set' );
291282 if ( $current != $new ) {
292283 $this->setRestrictions( $group, $new );
293284 $this->addLogEntry2( $group, $current, $new, $reason );
@@ -295,8 +286,8 @@
296287 $this->invalidateRightsCache( $group );
297288
298289 // Display success
299 - $wgOut->setSubTitle( wfMsg( 'centralauth-editgroup-success' ) );
300 - $wgOut->addWikiMsg( 'centralauth-editgroup-success-text', $group );
 290+ $this->getOutput()->setSubTitle( wfMsg( 'centralauth-editgroup-success' ) );
 291+ $this->getOutput()->addWikiMsg( 'centralauth-editgroup-success-text', $group );
301292 }
302293
303294 /**
Index: trunk/extensions/CentralAuth/specials/SpecialCentralAuth.php
@@ -16,29 +16,28 @@
1717 }
1818
1919 function execute( $subpage ) {
20 - global $wgOut;
21 - global $wgUser, $wgRequest, $wgContLang;
 20+ global $wgContLang;
2221 $this->setHeaders();
2322
24 - $this->mCanUnmerge = $wgUser->isAllowed( 'centralauth-unmerge' );
25 - $this->mCanLock = $wgUser->isAllowed( 'centralauth-lock' );
26 - $this->mCanOversight = $wgUser->isAllowed( 'centralauth-oversight' );
 23+ $this->mCanUnmerge = $this->getUser()->isAllowed( 'centralauth-unmerge' );
 24+ $this->mCanLock = $this->getUser()->isAllowed( 'centralauth-lock' );
 25+ $this->mCanOversight = $this->getUser()->isAllowed( 'centralauth-oversight' );
2726 $this->mCanEdit = $this->mCanUnmerge || $this->mCanLock || $this->mCanOversight;
2827
29 - $wgOut->addModules( 'ext.centralauth' );
30 - $wgOut->addModuleStyles( 'ext.centralauth.noflash' );
 28+ $this->getOutput()->addModules( 'ext.centralauth' );
 29+ $this->getOutput()->addModuleStyles( 'ext.centralauth.noflash' );
3130 $this->addMergeMethodDescriptions();
3231
3332 $this->mUserName =
3433 trim(
3534 str_replace( '_', ' ',
36 - $wgRequest->getText( 'target', $subpage ) ) );
 35+ $this->getRequest()->getText( 'target', $subpage ) ) );
3736
3837 $this->mUserName = $wgContLang->ucfirst( $this->mUserName );
3938
40 - $this->mPosted = $wgRequest->wasPosted();
41 - $this->mMethod = $wgRequest->getVal( 'wpMethod' );
42 - $this->mWikis = (array)$wgRequest->getArray( 'wpWikis' );
 39+ $this->mPosted = $this->getRequest()->wasPosted();
 40+ $this->mMethod = $this->getRequest()->getVal( 'wpMethod' );
 41+ $this->mWikis = (array)$this->getRequest()->getArray( 'wpWikis' );
4342
4443 // Possible demo states
4544
@@ -53,7 +52,7 @@
5453
5554 if ( $this->mUserName === '' ) {
5655 # First time through
57 - $wgOut->addWikiMsg( 'centralauth-admin-intro' );
 56+ $this->getOutput()->addWikiMsg( 'centralauth-admin-intro' );
5857 $this->showUsernameForm();
5958 return;
6059 }
@@ -97,8 +96,8 @@
9897 function doSubmit() {
9998 $deleted = false;
10099 $globalUser = $this->mGlobalUser;
101 - global $wgUser, $wgRequest;
102 - if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
 100+
 101+ if ( !$this->getUser()->matchEditToken( $this->getRequest()->getVal( 'wpEditToken' ) ) ) {
103102 $this->showError( 'centralauth-token-mismatch' );
104103 } elseif ( $this->mMethod == 'unmerge' && $this->mCanUnmerge ) {
105104 $status = $globalUser->adminUnattach( $this->mWikis );
@@ -117,11 +116,11 @@
118117 } else {
119118 $this->showSuccess( 'centralauth-admin-delete-success', $this->mUserName );
120119 $deleted = true;
121 - $this->logAction( 'delete', $this->mUserName, $wgRequest->getVal( 'reason' ) );
 120+ $this->logAction( 'delete', $this->mUserName, $this->getRequest()->getVal( 'reason' ) );
122121 }
123122 } elseif ( $this->mMethod == 'set-status' && $this->mCanLock ) {
124 - $setLocked = $wgRequest->getBool( 'wpStatusLocked' );
125 - $setHidden = $wgRequest->getVal( 'wpStatusHidden' );
 123+ $setLocked = $this->getRequest()->getBool( 'wpStatusLocked' );
 124+ $setHidden = $this->getRequest()->getVal( 'wpStatusHidden' );
126125 $isLocked = $globalUser->isLocked();
127126 $oldHiddenLevel = $globalUser->getHiddenLevel();
128127 $lockStatus = $hideStatus = null;
@@ -144,8 +143,8 @@
145144 $removed[] = wfMsgForContent( 'centralauth-log-status-locked' );
146145 }
147146
148 - $reason = $wgRequest->getText( 'wpReasonList' );
149 - $reasonDetail = $wgRequest->getText( 'wpReason' );
 147+ $reason = $this->getRequest()->getText( 'wpReasonList' );
 148+ $reasonDetail = $this->getRequest()->getText( 'wpReason' );
150149 if ( $reason == 'other' ) {
151150 $reason = $reasonDetail;
152151 } elseif ( $reasonDetail ) {
@@ -215,29 +214,26 @@
216215 * @param $wikitext string
217216 */
218217 function showStatusError( $wikitext ) {
219 - global $wgOut;
220218 $wrap = Xml::tags( 'div', array( 'class' => 'error' ), $wikitext );
221 - $wgOut->addHTML( $wgOut->parse( $wrap, /*linestart*/true, /*uilang*/true ) );
 219+ $this->getOutput()->addHTML( $this->getOutput()->parse( $wrap, /*linestart*/true, /*uilang*/true ) );
222220 }
223221
224222 function showError( /* varargs */ ) {
225 - global $wgOut;
226223 $args = func_get_args();
227 - $wgOut->wrapWikiMsg( '<div class="error">$1</div>', $args );
 224+ $this->getOutput()->wrapWikiMsg( '<div class="error">$1</div>', $args );
228225 }
229226
230227 function showSuccess( /* varargs */ ) {
231 - global $wgOut;
232228 $args = func_get_args();
233 - $wgOut->wrapWikiMsg( '<div class="success">$1</div>', $args );
 229+ $this->getOutput()->wrapWikiMsg( '<div class="success">$1</div>', $args );
234230 }
235231
236232 function showUsernameForm() {
237 - global $wgOut, $wgScript;
 233+ global $wgScript;
238234 $lookup = $this->mCanEdit ?
239235 wfMsg( 'centralauth-admin-lookup-rw' ) :
240236 wfMsg( 'centralauth-admin-lookup-ro' );
241 - $wgOut->addHTML(
 237+ $this->getOutput()->addHTML(
242238 Xml::openElement( 'form', array(
243239 'method' => 'get',
244240 'action' => $wgScript ) ) .
@@ -284,7 +280,7 @@
285281 function showInfo() {
286282 $globalUser = $this->mGlobalUser;
287283
288 - global $wgOut, $wgLang;
 284+ global $wgLang;
289285 $reg = $globalUser->getRegistration();
290286 $age = $this->prettyTimespan( wfTimestamp( TS_UNIX ) - wfTimestamp( TS_UNIX, $reg ) );
291287 $attribs = array(
@@ -302,11 +298,10 @@
303299 $data . '</li>';
304300 }
305301 $out .= '</ul></fieldset>';
306 - $wgOut->addHTML( $out );
 302+ $this->getOutput()->addHTML( $out );
307303 }
308304
309305 function showWikiLists() {
310 - global $wgOut;
311306 $merged = $this->mAttachedLocalAccounts;
312307 $remainder = $this->mUnattachedLocalAccounts;
313308
@@ -314,21 +309,20 @@
315310 wfMsgHtml( 'centralauth-admin-list-legend-rw' ) :
316311 wfMsgHtml( 'centralauth-admin-list-legend-ro' );
317312
318 - $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
319 - $wgOut->addHTML( $this->listHeader() );
320 - $wgOut->addHTML( $this->listMerged( $merged ) );
 313+ $this->getOutput()->addHTML( "<fieldset><legend>{$legend}</legend>" );
 314+ $this->getOutput()->addHTML( $this->listHeader() );
 315+ $this->getOutput()->addHTML( $this->listMerged( $merged ) );
321316 if ( $remainder ) {
322 - $wgOut->addHTML( $this->listRemainder( $remainder ) );
 317+ $this->getOutput()->addHTML( $this->listRemainder( $remainder ) );
323318 }
324 - $wgOut->addHTML( $this->listFooter() );
325 - $wgOut->addHTML( '</fieldset>' );
 319+ $this->getOutput()->addHTML( $this->listFooter() );
 320+ $this->getOutput()->addHTML( '</fieldset>' );
326321 }
327322
328323 /**
329324 * @return string
330325 */
331326 function listHeader() {
332 - global $wgUser;
333327 return
334328 Xml::openElement( 'form',
335329 array(
@@ -337,7 +331,7 @@
338332 $this->getTitle( $this->mUserName )->getLocalUrl( 'action=submit' ),
339333 'id' => 'mw-centralauth-merged' ) ) .
340334 Html::hidden( 'wpMethod', 'unmerge' ) .
341 - Html::hidden( 'wpEditToken', $wgUser->editToken() ) .
 335+ Html::hidden( 'wpEditToken', $this->getUser()->editToken() ) .
342336 Xml::openElement( 'table', array( 'class' => 'wikitable sortable mw-centralauth-wikislist' ) ) . "\n" .
343337 '<thead><tr>' .
344338 ( $this->mCanUnmerge ? '<th></th>' : '' ) .
@@ -573,8 +567,7 @@
574568 * @param $action String: Only 'delete' supported
575569 */
576570 function showActionForm( $action ) {
577 - global $wgOut, $wgUser;
578 - $wgOut->addHTML(
 571+ $this->getOutput()->addHTML(
579572 # to be able to find messages: centralauth-admin-delete-title,
580573 # centralauth-admin-delete-description, centralauth-admin-delete-button
581574 Xml::fieldset( wfMsg( "centralauth-admin-{$action}-title" ) ) .
@@ -583,7 +576,7 @@
584577 'action' => $this->getTitle()->getFullUrl( 'target=' . urlencode( $this->mUserName ) ),
585578 'id' => "mw-centralauth-$action" ) ) .
586579 Html::hidden( 'wpMethod', $action ) .
587 - Html::hidden( 'wpEditToken', $wgUser->editToken() ) .
 580+ Html::hidden( 'wpEditToken', $this->getUser()->editToken() ) .
588581 wfMsgExt( "centralauth-admin-{$action}-description", 'parse' ) .
589582 Xml::buildForm(
590583 array( 'centralauth-admin-reason' => Xml::input( 'reason',
@@ -595,11 +588,10 @@
596589
597590 function showStatusForm() {
598591 // Allows locking, hiding, locking and hiding.
599 - global $wgUser, $wgOut;
600592 $form = '';
601593 $form .= Xml::fieldset( wfMsg( 'centralauth-admin-status' ) );
602594 $form .= Html::hidden( 'wpMethod', 'set-status' );
603 - $form .= Html::hidden( 'wpEditToken', $wgUser->editToken() );
 595+ $form .= Html::hidden( 'wpEditToken', $this->getUser()->editToken() );
604596 $form .= wfMsgExt( 'centralauth-admin-status-intro', 'parse' );
605597
606598 // Radio buttons
@@ -670,14 +662,13 @@
671663 ),
672664 $form
673665 );
674 - $wgOut->addHTML( $form );
 666+ $this->getOutput()->addHTML( $form );
675667 }
676668
677669 /**
678670 *
679671 */
680672 function showLogExtract() {
681 - global $wgOut;
682673 $user = $this->mGlobalUser->getName();
683674 $text = '';
684675 $numRows = LogEventsList::showLogExtract(
@@ -687,7 +678,7 @@
688679 '',
689680 array( 'showIfEmpty' => true ) );
690681 if ( $numRows ) {
691 - $wgOut->addHTML( Xml::fieldset( wfMsg( 'centralauth-admin-logsnippet' ), $text ) );
 682+ $this->getOutput()->addHTML( Xml::fieldset( wfMsg( 'centralauth-admin-logsnippet' ), $text ) );
692683 }
693684 }
694685
@@ -717,7 +708,7 @@
718709 }
719710
720711 function addMergeMethodDescriptions() {
721 - global $wgOut, $wgLang;
 712+ global $wgLang;
722713 $js = "wgMergeMethodDescriptions = {\n";
723714 foreach ( array( 'primary', 'new', 'empty', 'password', 'mail', 'admin', 'login' ) as $method ) {
724715 $short = Xml::encodeJsVar( $wgLang->ucfirst( wfMsgHtml( "centralauth-merge-method-{$method}" ) ) );
@@ -725,7 +716,7 @@
726717 $js .= "\t'{$method}' : { 'short' : {$short}, 'desc' : {$desc} },\n";
727718 }
728719 $js .= "}";
729 - $wgOut->addInlineScript( $js );
 720+ $this->getOutput()->addInlineScript( $js );
730721 }
731722
732723 /**
Index: trunk/extensions/CentralAuth/specials/SpecialMergeAccount.php
@@ -8,40 +8,39 @@
99 }
1010
1111 function execute( $subpage ) {
12 - global $wgOut, $wgUser;
 12+ global $wgUser;
1313 $this->setHeaders();
1414
1515 if ( !$this->userCanExecute( $wgUser ) ) {
16 - $wgOut->addWikiMsg( 'centralauth-merge-denied' );
17 - $wgOut->addWikiMsg( 'centralauth-readmore-text' );
 16+ $this->getOutput()->addWikiMsg( 'centralauth-merge-denied' );
 17+ $this->getOutput()->addWikiMsg( 'centralauth-readmore-text' );
1818 return;
1919 }
2020
21 - if ( !$wgUser->isLoggedIn() ) {
 21+ if ( !$this->getUser()->isLoggedIn() ) {
2222 $loginpage = SpecialPage::getTitleFor( 'Userlogin' );
2323 $loginurl = $loginpage->getFullUrl( array( 'returnto' => $this->getTitle()->getPrefixedText() ) );
24 - $wgOut->addWikiMsg( 'centralauth-merge-notlogged', $loginurl );
25 - $wgOut->addWikiMsg( 'centralauth-readmore-text' );
 24+ $this->getOutput()->addWikiMsg( 'centralauth-merge-notlogged', $loginurl );
 25+ $this->getOutput()->addWikiMsg( 'centralauth-readmore-text' );
2626
2727 return;
2828 }
2929
3030 if ( wfReadOnly() ) {
31 - $wgOut->setPagetitle( wfMsg( 'readonly' ) );
32 - $wgOut->addWikiMsg( 'readonlytext', wfReadOnlyReason() );
 31+ $this->getOutput()->setPagetitle( wfMsg( 'readonly' ) );
 32+ $this->getOutput()->addWikiMsg( 'readonlytext', wfReadOnlyReason() );
3333 return;
3434 }
3535
36 - global $wgRequest;
37 - $this->mUserName = $wgUser->getName();
 36+ $this->mUserName = $this->getUser()->getName();
3837
39 - $this->mAttemptMerge = $wgRequest->wasPosted();
 38+ $this->mAttemptMerge = $this->getRequest()->wasPosted();
4039
41 - $this->mMergeAction = $wgRequest->getVal( 'wpMergeAction' );
42 - $this->mPassword = $wgRequest->getVal( 'wpPassword' );
43 - $this->mWikiIDs = $wgRequest->getArray( 'wpWikis' );
44 - $this->mSessionToken = $wgRequest->getVal( 'wpMergeSessionToken' );
45 - $this->mSessionKey = pack( "H*", $wgRequest->getVal( 'wpMergeSessionKey' ) );
 40+ $this->mMergeAction = $this->getRequest()->getVal( 'wpMergeAction' );
 41+ $this->mPassword = $this->getRequest()->getVal( 'wpPassword' );
 42+ $this->mWikiIDs = $this->getRequest()->getArray( 'wpWikis' );
 43+ $this->mSessionToken = $this->getRequest()->getVal( 'wpMergeSessionToken' );
 44+ $this->mSessionKey = pack( "H*", $this->getRequest()->getVal( 'wpMergeSessionKey' ) );
4645
4746 // Possible demo states
4847
@@ -96,7 +95,7 @@
9796 */
9897 private function initSession() {
9998 global $wgUser;
100 - $this->mSessionToken = $wgUser->generateToken();
 99+ $this->mSessionToken = $this->getUser()->generateToken();
101100
102101 // Generate a random binary string
103102 $key = '';
@@ -161,18 +160,18 @@
162161 }
163162
164163 function doDryRunMerge() {
165 - global $wgUser, $wgRequest, $wgOut, $wgCentralAuthDryRun;
166 - $globalUser = new CentralAuthUser( $wgUser->getName() );
 164+ global $wgCentralAuthDryRun;
 165+ $globalUser = new CentralAuthUser( $this->getUser()->getName() );
167166
168167 if ( $globalUser->exists() ) {
169168 throw new MWException( "Already exists -- race condition" );
170169 }
171170
172171 if ( $wgCentralAuthDryRun ) {
173 - $wgOut->addWikiMsg( 'centralauth-notice-dryrun' );
 172+ $this->getOutput()->addWikiMsg( 'centralauth-notice-dryrun' );
174173 }
175174
176 - $password = $wgRequest->getVal( 'wpPassword' );
 175+ $password = $this->getRequest()->getVal( 'wpPassword' );
177176 $this->addWorkingPassword( $password );
178177 $passwords = $this->getWorkingPasswords();
179178
@@ -186,23 +185,23 @@
187186 // This is the global account or matched it
188187 if ( count( $unattached ) == 0 ) {
189188 // Everything matched -- very convenient!
190 - $wgOut->addWikiMsg( 'centralauth-merge-dryrun-complete' );
 189+ $this->getOutput()->addWikiMsg( 'centralauth-merge-dryrun-complete' );
191190 } else {
192 - $wgOut->addWikiMsg( 'centralauth-merge-dryrun-incomplete' );
 191+ $this->getOutput()->addWikiMsg( 'centralauth-merge-dryrun-incomplete' );
193192 }
194193
195194 if ( count( $unattached ) > 0 ) {
196 - $wgOut->addHTML( $this->step2PasswordForm( $unattached ) );
197 - $wgOut->addWikiMsg( 'centralauth-merge-dryrun-or' );
 195+ $this->getOutput()->addHTML( $this->step2PasswordForm( $unattached ) );
 196+ $this->getOutput()->addWikiMsg( 'centralauth-merge-dryrun-or' );
198197 }
199198
200199 $subAttached = array_diff( $attached, array( $home ) );
201 - $wgOut->addHTML( $this->step3ActionForm( $home, $subAttached, $methods ) );
 200+ $this->getOutput()->addHTML( $this->step3ActionForm( $home, $subAttached, $methods ) );
202201 } else {
203202 // Show error message from status
204 - $wgOut->addHTML( '<div class="errorbox" style="float:none;">' );
205 - $wgOut->addWikiText( $status->getWikiText() );
206 - $wgOut->addHTML( '</div>' );
 203+ $this->getOutput()->addHTML( '<div class="errorbox" style="float:none;">' );
 204+ $this->getOutput()->addWikiText( $status->getWikiText() );
 205+ $this->getOutput()->addHTML( '</div>' );
207206
208207 // Show wiki list if required
209208 if ( $status->hasMessage( 'centralauth-blocked-text' )
@@ -211,17 +210,17 @@
212211 $out = '<h2>' . wfMsgHtml( 'centralauth-list-home-title' ) . '</h2>';
213212 $out .= wfMsgExt( 'centralauth-list-home-dryrun', 'parse' );
214213 $out .= $this->listAttached( array( $home ), array( $home => 'primary' ) );
215 - $wgOut->addHTML( $out );
 214+ $this->getOutput()->addHTML( $out );
216215 }
217216
218217 // Show password box
219 - $wgOut->addHTML( $this->step1PasswordForm() );
 218+ $this->getOutput()->addHTML( $this->step1PasswordForm() );
220219 }
221220 }
222221
223222 function doInitialMerge() {
224223 global $wgUser, $wgCentralAuthDryRun;
225 - $globalUser = new CentralAuthUser( $wgUser->getName() );
 224+ $globalUser = new CentralAuthUser( $this->getUser()->getName() );
226225
227226 if ( $wgCentralAuthDryRun ) {
228227 $this->dryRunError();
@@ -244,8 +243,8 @@
245244 }
246245
247246 function doCleanupMerge() {
248 - global $wgUser, $wgRequest, $wgOut, $wgCentralAuthDryRun;
249 - $globalUser = new CentralAuthUser( $wgUser->getName() );
 247+ global $wgCentralAuthDryRun;
 248+ $globalUser = new CentralAuthUser( $this->getUser()->getName() );
250249
251250 if ( !$globalUser->exists() ) {
252251 throw new MWException( "User doesn't exist -- race condition?" );
@@ -259,7 +258,7 @@
260259 $this->dryRunError();
261260 return;
262261 }
263 - $password = $wgRequest->getText( 'wpPassword' );
 262+ $password = $this->getRequest()->getText( 'wpPassword' );
264263
265264 $attached = array();
266265 $unattached = array();
@@ -268,17 +267,17 @@
269268
270269 if ( !$ok ) {
271270 if ( empty( $attached ) ) {
272 - $wgOut->addWikiMsg( 'centralauth-finish-noconfirms' );
 271+ $this->getOutput()->addWikiMsg( 'centralauth-finish-noconfirms' );
273272 } else {
274 - $wgOut->addWikiMsg( 'centralauth-finish-incomplete' );
 273+ $this->getOutput()->addWikiMsg( 'centralauth-finish-incomplete' );
275274 }
276275 }
277276 $this->showCleanupForm();
278277 }
279278
280279 function doAttachMerge() {
281 - global $wgUser, $wgRequest, $wgOut, $wgCentralAuthDryRun;
282 - $globalUser = new CentralAuthUser( $wgUser->getName() );
 280+ global $wgCentralAuthDryRun;
 281+ $globalUser = new CentralAuthUser( $this->getUser()->getName() );
283282
284283 if ( !$globalUser->exists() ) {
285284 throw new MWException( "User doesn't exist -- race condition?" );
@@ -292,13 +291,13 @@
293292 $this->dryRunError();
294293 return;
295294 }
296 - $password = $wgRequest->getText( 'wpPassword' );
 295+ $password = $this->getRequest()->getText( 'wpPassword' );
297296 if ( $globalUser->authenticate( $password ) == 'ok' ) {
298297 $globalUser->attach( wfWikiID(), 'password' );
299 - $wgOut->addWikiMsg( 'centralauth-attach-success' );
 298+ $this->getOutput()->addWikiMsg( 'centralauth-attach-success' );
300299 $this->showCleanupForm();
301300 } else {
302 - $wgOut->addHTML(
 301+ $this->getOutput()->addHTML(
303302 '<div class="errorbox">' .
304303 wfMsg( 'wrongpassword' ) .
305304 '</div>' .
@@ -307,17 +306,17 @@
308307 }
309308
310309 private function showWelcomeForm() {
311 - global $wgOut, $wgCentralAuthDryRun;
 310+ global $wgCentralAuthDryRun;
312311
313312 if ( $wgCentralAuthDryRun ) {
314 - $wgOut->addWikiMsg( 'centralauth-notice-dryrun' );
 313+ $this->getOutput()->addWikiMsg( 'centralauth-notice-dryrun' );
315314 }
316315
317 - $wgOut->addWikiMsg( 'centralauth-merge-welcome' );
318 - $wgOut->addWikiMsg( 'centralauth-readmore-text' );
 316+ $this->getOutput()->addWikiMsg( 'centralauth-merge-welcome' );
 317+ $this->getOutput()->addWikiMsg( 'centralauth-readmore-text' );
319318
320319 $this->initSession();
321 - $wgOut->addHTML(
 320+ $this->getOutput()->addHTML(
322321 $this->passwordForm(
323322 'dryrun',
324323 wfMsg( 'centralauth-merge-step1-title' ),
@@ -328,7 +327,7 @@
329328
330329 function showCleanupForm() {
331330 global $wgUser;
332 - $globalUser = new CentralAuthUser( $wgUser->getName() );
 331+ $globalUser = new CentralAuthUser( $this->getUser()->getName() );
333332
334333 $merged = $globalUser->listAttached();
335334 $remainder = $globalUser->listUnattached();
@@ -336,12 +335,11 @@
337336 }
338337
339338 function showAttachForm() {
340 - global $wgOut, $wgUser;
341 - $globalUser = new CentralAuthUser( $wgUser->getName() );
 339+ $globalUser = new CentralAuthUser( $this->getUser()->getName() );
342340 $merged = $globalUser->listAttached();
343 - $wgOut->addWikiMsg( 'centralauth-attach-list-attached', $this->mUserName );
344 - $wgOut->addHTML( $this->listAttached( $merged ) );
345 - $wgOut->addHTML( $this->attachActionForm() );
 341+ $this->getOutput()->addWikiMsg( 'centralauth-attach-list-attached', $this->mUserName );
 342+ $this->getOutput()->addHTML( $this->listAttached( $merged ) );
 343+ $this->getOutput()->addHTML( $this->attachActionForm() );
346344 }
347345
348346 /**
@@ -349,32 +347,30 @@
350348 * @param $remainder
351349 */
352350 function showStatus( $merged, $remainder ) {
353 - global $wgOut;
354 -
355351 if ( count( $remainder ) > 0 ) {
356 - $wgOut->setPageTitle( wfMsg( 'centralauth-incomplete' ) );
357 - $wgOut->addWikiMsg( 'centralauth-incomplete-text' );
 352+ $this->getOutput()->setPageTitle( wfMsg( 'centralauth-incomplete' ) );
 353+ $this->getOutput()->addWikiMsg( 'centralauth-incomplete-text' );
358354 } else {
359 - $wgOut->setPageTitle( wfMsg( 'centralauth-complete' ) );
360 - $wgOut->addWikiMsg( 'centralauth-complete-text' );
 355+ $this->getOutput()->setPageTitle( wfMsg( 'centralauth-complete' ) );
 356+ $this->getOutput()->addWikiMsg( 'centralauth-complete-text' );
361357 }
362 - $wgOut->addWikiMsg( 'centralauth-readmore-text' );
 358+ $this->getOutput()->addWikiMsg( 'centralauth-readmore-text' );
363359
364360 if ( $merged ) {
365 - $wgOut->addHTML( '<hr />' );
366 - $wgOut->addWikiMsg( 'centralauth-list-attached',
 361+ $this->getOutput()->addHTML( '<hr />' );
 362+ $this->getOutput()->addWikiMsg( 'centralauth-list-attached',
367363 $this->mUserName );
368 - $wgOut->addHTML( $this->listAttached( $merged ) );
 364+ $this->getOutput()->addHTML( $this->listAttached( $merged ) );
369365 }
370366
371367 if ( $remainder ) {
372 - $wgOut->addHTML( '<hr />' );
373 - $wgOut->addWikiMsg( 'centralauth-list-unattached',
 368+ $this->getOutput()->addHTML( '<hr />' );
 369+ $this->getOutput()->addWikiMsg( 'centralauth-list-unattached',
374370 $this->mUserName );
375 - $wgOut->addHTML( $this->listUnattached( $remainder ) );
 371+ $this->getOutput()->addHTML( $this->listUnattached( $remainder ) );
376372
377373 // Try the password form!
378 - $wgOut->addHTML( $this->passwordForm(
 374+ $this->getOutput()->addHTML( $this->passwordForm(
379375 'cleanup',
380376 wfMsg( 'centralauth-finish-title' ),
381377 wfMsgExt( 'centralauth-finish-text', array( 'parse' ) ),
@@ -479,7 +475,7 @@
480476 'method' => 'post',
481477 'action' => $this->getTitle()->getLocalUrl( 'action=submit' ) ) ) .
482478 Xml::element( 'h2', array(), $title ) .
483 - Html::hidden( 'wpEditToken', $wgUser->editToken() ) .
 479+ Html::hidden( 'wpEditToken', $this->getUser()->editToken() ) .
484480 Html::hidden( 'wpMergeAction', $action ) .
485481 Html::hidden( 'wpMergeSessionToken', $this->mSessionToken ) .
486482 Html::hidden( 'wpMergeSessionKey', bin2hex( $this->mSessionKey ) ) .
@@ -550,7 +546,7 @@
551547 return $this->passwordForm(
552548 'dryrun',
553549 wfMsg( 'centralauth-merge-step2-title' ),
554 - wfMsgExt( 'centralauth-merge-step2-detail', 'parse', $wgUser->getName() ) .
 550+ wfMsgExt( 'centralauth-merge-step2-detail', 'parse', $this->getUser()->getName() ) .
555551 $this->listUnattached( $unattached ),
556552 wfMsg( 'centralauth-merge-step2-submit' ) );
557553 }
@@ -566,13 +562,13 @@
567563 return $this->actionForm(
568564 'initial',
569565 wfMsg( 'centralauth-merge-step3-title' ),
570 - wfMsgExt( 'centralauth-merge-step3-detail', 'parse', $wgUser->getName() ) .
 566+ wfMsgExt( 'centralauth-merge-step3-detail', 'parse', $this->getUser()->getName() ) .
571567 '<h3>' . wfMsgHtml( 'centralauth-list-home-title' ) . '</h3>' .
572568 wfMsgExt( 'centralauth-list-home-dryrun', 'parse' ) .
573569 $this->listAttached( array( $home ), $methods ) .
574570 ( count( $attached )
575571 ? ( '<h3>' . wfMsgHtml( 'centralauth-list-attached-title' ) . '</h3>' .
576 - wfMsgExt( 'centralauth-list-attached-dryrun', 'parse', $wgUser->getName() ) )
 572+ wfMsgExt( 'centralauth-list-attached-dryrun', 'parse', $this->getUser()->getName() ) )
577573 : '' ) .
578574 $this->listAttached( $attached, $methods ) .
579575 '<p>' .
@@ -594,7 +590,6 @@
595591 }
596592
597593 private function dryRunError() {
598 - global $wgOut;
599 - $wgOut->addWikiMsg( 'centralauth-disabled-dryrun' );
 594+ $this->getOutput()->addWikiMsg( 'centralauth-disabled-dryrun' );
600595 }
601596 }
Index: trunk/extensions/CentralAuth/specials/SpecialAutoLogin.php
@@ -14,17 +14,17 @@
1515 }
1616
1717 function execute( $par ) {
18 - global $wgRequest, $wgOut, $wgMemc;
 18+ global $wgMemc;
1919
20 - $tempToken = $wgRequest->getVal( 'token' );
21 - $logout = $wgRequest->getBool( 'logout' );
 20+ $tempToken = $this->getRequest()->getVal( 'token' );
 21+ $logout = $this->getRequest()->getBool( 'logout' );
2222
2323 # Don't cache error messages
24 - $wgOut->enableClientCache( false );
 24+ $this->getOutput()->enableClientCache( false );
2525
2626 if ( strlen( $tempToken ) == 0 ) {
2727 $this->setHeaders();
28 - $wgOut->addWikiMsg( 'centralauth-autologin-desc' );
 28+ $this->getOutput()->addWikiMsg( 'centralauth-autologin-desc' );
2929 return;
3030 }
3131
@@ -36,7 +36,7 @@
3737 $msg = 'Token is invalid or has expired';
3838 wfDebug( __METHOD__ . ": $msg\n" );
3939 $this->setHeaders();
40 - $wgOut->addWikiText( $msg );
 40+ $this->getOutput()->addWikiText( $msg );
4141 return;
4242 }
4343
@@ -48,7 +48,7 @@
4949 $msg = 'Bad token (wrong wiki)';
5050 wfDebug( __METHOD__ . ": $msg\n" );
5151 $this->setHeaders();
52 - $wgOut->addWikiText( $msg );
 52+ $this->getOutput()->addWikiText( $msg );
5353 return;
5454 }
5555
@@ -59,7 +59,7 @@
6060 $msg = "Bad token: $loginResult";
6161 wfDebug( __METHOD__ . ": $msg\n" );
6262 $this->setHeaders();
63 - $wgOut->addWikiText( $msg );
 63+ $this->getOutput()->addWikiText( $msg );
6464 return;
6565 }
6666
@@ -70,7 +70,7 @@
7171 $centralUser->setGlobalCookies( $remember );
7272 }
7373
74 - $wgOut->disable();
 74+ $this->getOutput()->disable();
7575
7676 wfResetOutputBuffers();
7777 header( 'Cache-Control: no-cache' );
Index: trunk/extensions/CentralAuth/specials/SpecialGlobalUsers.php
@@ -6,7 +6,7 @@
77 }
88
99 function execute( $par ) {
10 - global $wgOut, $wgRequest, $wgContLang;
 10+ global $wgContLang;
1111 $this->setHeaders();
1212
1313 $pg = new GlobalUsersPager( $this->getContext(), $par );
@@ -14,19 +14,19 @@
1515 if ( $par ) {
1616 $pg->setGroup( $par );
1717 }
18 - $rqGroup = $wgRequest->getVal( 'group' );
 18+ $rqGroup = $this->getRequest()->getVal( 'group' );
1919 if ( $rqGroup ) {
2020 $pg->setGroup( $rqGroup );
2121 }
22 - $rqUsername = $wgContLang->ucfirst( $wgRequest->getVal( 'username' ) );
 22+ $rqUsername = $wgContLang->ucfirst( $this->getRequest()->getVal( 'username' ) );
2323 if ( $rqUsername ) {
2424 $pg->setUsername( $rqUsername );
2525 }
2626
27 - $wgOut->addHTML( $pg->getPageHeader() );
28 - $wgOut->addHTML( $pg->getNavigationBar() );
29 - $wgOut->addHTML( '<ul>' . $pg->getBody() . '</ul>' );
30 - $wgOut->addHTML( $pg->getNavigationBar() );
 27+ $this->getOutput()->addHTML( $pg->getPageHeader() );
 28+ $this->getOutput()->addHTML( $pg->getNavigationBar() );
 29+ $this->getOutput()->addHTML( '<ul>' . $pg->getBody() . '</ul>' );
 30+ $this->getOutput()->addHTML( $pg->getNavigationBar() );
3131 }
3232 }
3333
Index: trunk/extensions/CentralAuth/specials/SpecialWikiSets.php
@@ -27,16 +27,14 @@
2828 }
2929
3030 function execute( $subpage ) {
31 - global $wgRequest, $wgOut, $wgUser;
 31+ $this->mCanEdit = $this->getUser()->isAllowed( 'globalgrouppermissions' );
3232
33 - $this->mCanEdit = $wgUser->isAllowed( 'globalgrouppermissions' );
34 -
3533 $this->setHeaders();
3634
3735 if ( strpos( $subpage, 'delete/' ) === 0 && $this->mCanEdit ) {
3836 $subpage = substr( $subpage, 7 ); // Remove delete/ part
3937 if ( is_numeric( $subpage ) ) {
40 - if ( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
 38+ if ( $this->getUser()->matchEditToken( $this->getRequest()->getVal( 'wpEditToken' ) ) ) {
4139 $this->doDelete( $subpage );
4240 } else {
4341 $this->buildDeleteView( $subpage );
@@ -51,14 +49,14 @@
5250 if ( $set ) {
5351 $subpage = $set->getID();
5452 } else {
55 - $wgOut->setPageTitle( wfMsg( 'error' ) );
 53+ $this->getOutput()->setPageTitle( wfMsg( 'error' ) );
5654 $error = wfMsgExt( 'centralauth-editset-notfound', array( 'escapenoentities' ), $subpage );
5755 $this->buildMainView( "<strong class='error'>{$error}</strong>" );
5856 return;
5957 }
6058 }
6159
62 - if ( ( $subpage || $newPage ) && $this->mCanEdit && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
 60+ if ( ( $subpage || $newPage ) && $this->mCanEdit && $this->getUser()->matchEditToken( $this->getRequest()->getVal( 'wpEditToken' ) ) ) {
6361 $this->doSubmit( $subpage );
6462 } elseif ( ( $subpage || $newPage ) && is_numeric( $subpage ) ) {
6563 $this->buildSetView( $subpage );
@@ -72,29 +70,27 @@
7371 * @param string $msg
7472 */
7573 function buildMainView( $msg = '' ) {
76 - global $wgOut;
77 -
7874 $msgPostfix = $this->mCanEdit ? 'rw' : 'ro';
7975 $legend = wfMsg( "centralauth-editset-legend-{$msgPostfix}" );
80 - $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
 76+ $this->getOutput()->addHTML( "<fieldset><legend>{$legend}</legend>" );
8177 if ( $msg )
82 - $wgOut->addHTML( $msg );
83 - $wgOut->addWikiMsg( "centralauth-editset-intro-{$msgPostfix}" );
84 - $wgOut->addHTML( '<ul>' );
 78+ $this->getOutput()->addHTML( $msg );
 79+ $this->getOutput()->addWikiMsg( "centralauth-editset-intro-{$msgPostfix}" );
 80+ $this->getOutput()->addHTML( '<ul>' );
8581
8682 $sets = WikiSet::getAllWikiSets();
8783 foreach ( $sets as $set ) {
8884 $text = wfMsgExt( "centralauth-editset-item-{$msgPostfix}", array( 'parseinline' ), $set->getName(), $set->getID() );
89 - $wgOut->addHTML( "<li>{$text}</li>" );
 85+ $this->getOutput()->addHTML( "<li>{$text}</li>" );
9086 }
9187
9288 if ( $this->mCanEdit ) {
9389 $target = SpecialPage::getTitleFor( 'WikiSets', '0' );
9490 $newlink = Linker::makeLinkObj( $target, wfMsgHtml( 'centralauth-editset-new' ) );
95 - $wgOut->addHTML( "<li>{$newlink}</li>" );
 91+ $this->getOutput()->addHTML( "<li>{$newlink}</li>" );
9692 }
9793
98 - $wgOut->addHTML( '</ul></fieldset>' );
 94+ $this->getOutput()->addHTML( '</ul></fieldset>' );
9995 }
10096
10197 /**
@@ -106,9 +102,9 @@
107103 * @param $reason
108104 */
109105 function buildSetView( $subpage, $error = false, $name = null, $type = null, $wikis = null, $reason = null ) {
110 - global $wgOut, $wgUser, $wgLocalDatabases;
 106+ global $wgLocalDatabases;
111107
112 - $wgOut->setSubtitle( wfMsgExt( 'centralauth-editset-subtitle', 'parseinline' ) );
 108+ $this->getOutput()->setSubtitle( wfMsgExt( 'centralauth-editset-subtitle', 'parseinline' ) );
113109
114110 $set = ( $subpage || $subpage === '0' ) ? WikiSet::newFromID( $subpage ) : null;
115111
@@ -123,7 +119,7 @@
124120 $legend = wfMsgHtml( 'centralauth-editset-legend-view', $name );
125121 }
126122
127 - $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
 123+ $this->getOutput()->addHTML( "<fieldset><legend>{$legend}</legend>" );
128124
129125 if ( $set ) {
130126 $groups = $set->getRestrictedGroups();
@@ -154,9 +150,9 @@
155151
156152 if ( $this->mCanEdit ) {
157153 if ( $error ) {
158 - $wgOut->addHTML( "<strong class='error'>{$error}</strong>" );
 154+ $this->getOutput()->addHTML( "<strong class='error'>{$error}</strong>" );
159155 }
160 - $wgOut->addHTML( "<form action='{$url}' method='post'>" );
 156+ $this->getOutput()->addHTML( "<form action='{$url}' method='post'>" );
161157
162158 $form = array();
163159 $form['centralauth-editset-name'] = Xml::input( 'wpName', false, $name );
@@ -169,10 +165,10 @@
170166 implode( "\n", $restWikis ), 40, 5, array( 'readonly' => true ) );
171167 $form['centralauth-editset-reason'] = Xml::input( 'wpReason', 50, $reason );
172168
173 - $wgOut->addHTML( Xml::buildForm( $form, 'centralauth-editset-submit' ) );
 169+ $this->getOutput()->addHTML( Xml::buildForm( $form, 'centralauth-editset-submit' ) );
174170
175 - $edittoken = Html::hidden( 'wpEditToken', $wgUser->editToken() );
176 - $wgOut->addHTML( "<p>{$edittoken}</p></form></fieldset>" );
 171+ $edittoken = Html::hidden( 'wpEditToken', $this->getUser()->editToken() );
 172+ $this->getOutput()->addHTML( "<p>{$edittoken}</p></form></fieldset>" );
177173 } else {
178174 $form = array();
179175 $form['centralauth-editset-name'] = htmlspecialchars( $name );
@@ -181,7 +177,7 @@
182178 $form['centralauth-editset-wikis'] = self::buildTableByList( $sortedWikis, 3, array( 'width' => '100%' ) );
183179 $form['centralauth-editset-restwikis'] = self::buildTableByList( $restWikis, 3, array( 'width' => '100%' ) );
184180
185 - $wgOut->addHTML( Xml::buildForm( $form ) );
 181+ $this->getOutput()->addHTML( Xml::buildForm( $form ) );
186182 }
187183 }
188184
@@ -243,8 +239,7 @@
244240 * @return mixed
245241 */
246242 function buildDeleteView( $subpage ) {
247 - global $wgOut, $wgUser;
248 - $wgOut->setSubtitle( wfMsgExt( 'centralauth-editset-subtitle', 'parseinline' ) );
 243+ $this->getOutput()->setSubtitle( wfMsgExt( 'centralauth-editset-subtitle', 'parseinline' ) );
249244
250245 $set = WikiSet::newFromID( $subpage );
251246 if ( !$set ) {
@@ -255,11 +250,11 @@
256251 $legend = wfMsgHtml( 'centralauth-editset-legend-delete', $set->getName() );
257252 $form = array( 'centralauth-editset-reason' => Xml::input( 'wpReason' ) );
258253 $url = htmlspecialchars( SpecialPage::getTitleFor( 'WikiSets', "delete/{$subpage}" )->getLocalUrl() );
259 - $edittoken = Html::hidden( 'wpEditToken', $wgUser->editToken() );
 254+ $edittoken = Html::hidden( 'wpEditToken', $this->getUser()->editToken() );
260255
261 - $wgOut->addHTML( "<fieldset><legend>{$legend}</legend><form action='{$url}' method='post'>" );
262 - $wgOut->addHTML( Xml::buildForm( $form, 'centralauth-editset-submit-delete' ) );
263 - $wgOut->addHTML( "<p>{$edittoken}</p></form></fieldset>" );
 256+ $this->getOutput()->addHTML( "<fieldset><legend>{$legend}</legend><form action='{$url}' method='post'>" );
 257+ $this->getOutput()->addHTML( Xml::buildForm( $form, 'centralauth-editset-submit-delete' ) );
 258+ $this->getOutput()->addHTML( "<p>{$edittoken}</p></form></fieldset>" );
264259 }
265260
266261 /**
@@ -267,12 +262,12 @@
268263 * @return mixed
269264 */
270265 function doSubmit( $id ) {
271 - global $wgRequest, $wgContLang;
 266+ global $wgContLang;
272267
273 - $name = $wgContLang->ucfirst( $wgRequest->getVal( 'wpName' ) );
274 - $type = $wgRequest->getVal( 'wpType' );
275 - $wikis = array_unique( preg_split( '/(\s+|\s*\W\s*)/', $wgRequest->getVal( 'wpWikis' ), -1, PREG_SPLIT_NO_EMPTY ) );
276 - $reason = $wgRequest->getVal( 'wpReason' );
 268+ $name = $wgContLang->ucfirst( $this->getRequest()->getVal( 'wpName' ) );
 269+ $type = $this->getRequest()->getVal( 'wpType' );
 270+ $wikis = array_unique( preg_split( '/(\s+|\s*\W\s*)/', $this->getRequest()->getVal( 'wpWikis' ), -1, PREG_SPLIT_NO_EMPTY ) );
 271+ $reason = $this->getRequest()->getVal( 'wpReason' );
277272 $set = WikiSet::newFromId( $id );
278273
279274 if ( !Title::newFromText( $name ) ) {
@@ -337,10 +332,9 @@
338333 }
339334 }
340335
341 - global $wgOut;
342336 $returnLink = Linker::makeKnownLinkObj( $this->getTitle(), wfMsg( 'centralauth-editset-return' ) );
343337
344 - $wgOut->addHTML( '<strong class="success">' . wfMsgHtml( 'centralauth-editset-success' ) . '</strong> <p>' . $returnLink . '</p>' );
 338+ $this->getOutput()->addHTML( '<strong class="success">' . wfMsgHtml( 'centralauth-editset-success' ) . '</strong> <p>' . $returnLink . '</p>' );
345339 }
346340
347341 /**
@@ -348,15 +342,13 @@
349343 * @return mixed
350344 */
351345 function doDelete( $set ) {
352 - global $wgRequest;
353 -
354346 $set = WikiSet::newFromID( $set );
355347 if ( !$set ) {
356348 $this->buildMainView( '<strong class="error">' . wfMsgHtml( 'centralauth-editset-notfound', $set ) . '</strong>' );
357349 return;
358350 }
359351
360 - $reason = $wgRequest->getVal( 'wpReason' );
 352+ $reason = $this->getRequest()->getVal( 'wpReason' );
361353 $name = $set->getName();
362354 $set->delete();
363355

Status & tagging log