Index: branches/wmf-deployment/extensions/CentralAuth/SpecialGlobalGroupMembership.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | | - static function fetchUser( $username ) { |
| 76 | + function fetchUser( $username ) { |
77 | 77 | global $wgUser, $wgRequest; |
78 | 78 | |
79 | 79 | $knownwiki = $wgRequest->getVal('wpKnownWiki'); |
Index: branches/wmf-deployment/includes/api/ApiUserrights.php |
— | — | @@ -45,7 +45,8 @@ |
46 | 46 | if(is_null($params['token'])) |
47 | 47 | $this->dieUsageMsg(array('missingparam', 'token')); |
48 | 48 | |
49 | | - $user = UserrightsPage::fetchUser($params['user']); |
| 49 | + $form = new UserrightsPage; |
| 50 | + $user = $form->fetchUser($params['user']); |
50 | 51 | if($user instanceof WikiErrorMsg) |
51 | 52 | $this->dieUsageMsg(array_merge( |
52 | 53 | (array)$user->getMessageKey(), |
Index: branches/wmf-deployment/includes/api/ApiQueryUsers.php |
— | — | @@ -170,26 +170,9 @@ |
171 | 171 | } |
172 | 172 | // Second pass: add result data to $retval |
173 | 173 | foreach($goodNames as $u) { |
174 | | - if(!isset($data[$u])) { |
175 | | - $data[$u] = array('name' => $u); |
176 | | - $iwUser = UserrightsPage::fetchUser($u); |
177 | | - if($iwUser instanceof UserRightsProxy) { |
178 | | - $data[$u]['interwiki'] = ''; |
179 | | - if(!is_null($params['token'])) |
180 | | - { |
181 | | - $tokenFunctions = $this->getTokenFunctions(); |
182 | | - foreach($params['token'] as $t) |
183 | | - { |
184 | | - $val = call_user_func($tokenFunctions[$t], $iwUser); |
185 | | - if($val === false) |
186 | | - $this->setWarning("Action '$t' is not allowed for the current user"); |
187 | | - else |
188 | | - $data[$u][$t . 'token'] = $val; |
189 | | - } |
190 | | - } |
191 | | - } else |
192 | | - $data[$u]['missing'] = ''; |
193 | | - } else { |
| 174 | + if(!isset($data[$u])) |
| 175 | + $data[$u] = array('name' => $u, 'missing' => ''); |
| 176 | + else { |
194 | 177 | if(isset($this->prop['groups']) && isset($data[$u]['groups'])) |
195 | 178 | $this->getResult()->setIndexedTagName($data[$u]['groups'], 'g'); |
196 | 179 | } |
Index: branches/wmf-deployment/includes/specials/SpecialUserrights.php |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | function saveUserGroups( $username, $reason = '' ) { |
146 | 146 | global $wgRequest, $wgUser, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf; |
147 | 147 | |
148 | | - $user = self::fetchUser( $username ); |
| 148 | + $user = $this->fetchUser( $username ); |
149 | 149 | if( $user instanceof WikiErrorMsg ) { |
150 | 150 | $wgOut->addWikiMsgArray( $user->getMessageKey(), $user->getMessageArgs() ); |
151 | 151 | return; |
— | — | @@ -250,7 +250,7 @@ |
251 | 251 | function editUserGroupsForm( $username ) { |
252 | 252 | global $wgOut; |
253 | 253 | |
254 | | - $user = self::fetchUser( $username ); |
| 254 | + $user = $this->fetchUser( $username ); |
255 | 255 | if( $user instanceof WikiErrorMsg ) { |
256 | 256 | $wgOut->addWikiMsgArray( $user->getMessageKey(), $user->getMessageArgs() ); |
257 | 257 | return; |