r56534 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56533‎ | r56534 | r56535 >
Date:16:21, 17 September 2009
Author:mrzman
Status:ok
Tags:
Comment:
merge most of r56515 back to trunk (changing UserrightsPage::fetchUser to non-static)
Fixing ApiQueryUsers so it should work properly for interwiki users
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryUsers.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUserrights.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserrights.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiUserrights.php
@@ -44,8 +44,9 @@
4545 $this->dieUsageMsg(array('missingparam', 'user'));
4646 if(is_null($params['token']))
4747 $this->dieUsageMsg(array('missingparam', 'token'));
48 -
49 - $user = UserrightsPage::fetchUser($params['user']);
 48+
 49+ $form = new UserrightsPage;
 50+ $user = $form->fetchUser($params['user']);
5051 if($user instanceof WikiErrorMsg)
5152 $this->dieUsageMsg(array_merge(
5253 (array)$user->getMessageKey(),
Index: trunk/phase3/includes/api/ApiQueryUsers.php
@@ -172,7 +172,8 @@
173173 foreach($goodNames as $u) {
174174 if(!isset($data[$u])) {
175175 $data[$u] = array('name' => $u);
176 - $iwUser = UserrightsPage::fetchUser($u);
 176+ $urPage = new UserrightsPage;
 177+ $iwUser = $urPage->fetchUser($u);
177178 if($iwUser instanceof UserRightsProxy) {
178179 $data[$u]['interwiki'] = '';
179180 if(!is_null($params['token']))
Index: trunk/phase3/includes/specials/SpecialUserrights.php
@@ -144,7 +144,7 @@
145145 function saveUserGroups( $username, $reason = '' ) {
146146 global $wgRequest, $wgUser, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
147147
148 - $user = self::fetchUser( $username );
 148+ $user = $this->fetchUser( $username );
149149 if( $user instanceof WikiErrorMsg ) {
150150 $wgOut->addWikiMsgArray( $user->getMessageKey(), $user->getMessageArgs() );
151151 return;
@@ -250,7 +250,7 @@
251251 function editUserGroupsForm( $username ) {
252252 global $wgOut;
253253
254 - $user = self::fetchUser( $username );
 254+ $user = $this->fetchUser( $username );
255255 if( $user instanceof WikiErrorMsg ) {
256256 $wgOut->addWikiMsgArray( $user->getMessageKey(), $user->getMessageArgs() );
257257 return;
@@ -272,7 +272,7 @@
273273 * Side effects: error output for invalid access
274274 * @return mixed User, UserRightsProxy, or WikiErrorMsg
275275 */
276 - public static function fetchUser( $username ) {
 276+ public function fetchUser( $username ) {
277277 global $wgUser, $wgUserrightsInterwikiDelimiter;
278278
279279 $parts = explode( $wgUserrightsInterwikiDelimiter, $username );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56515Revert r56450 (encompassing r56447 and r56448) and r56133 on wmf-deployment. ...werdna14:30, 17 September 2009

Status & tagging log