Index: trunk/phase3/includes/api/ApiUserrights.php |
— | — | @@ -44,8 +44,9 @@ |
45 | 45 | $this->dieUsageMsg(array('missingparam', 'user')); |
46 | 46 | if(is_null($params['token'])) |
47 | 47 | $this->dieUsageMsg(array('missingparam', 'token')); |
48 | | - |
49 | | - $user = UserrightsPage::fetchUser($params['user']); |
| 48 | + |
| 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: trunk/phase3/includes/api/ApiQueryUsers.php |
— | — | @@ -172,7 +172,8 @@ |
173 | 173 | foreach($goodNames as $u) { |
174 | 174 | if(!isset($data[$u])) { |
175 | 175 | $data[$u] = array('name' => $u); |
176 | | - $iwUser = UserrightsPage::fetchUser($u); |
| 176 | + $urPage = new UserrightsPage; |
| 177 | + $iwUser = $urPage->fetchUser($u); |
177 | 178 | if($iwUser instanceof UserRightsProxy) { |
178 | 179 | $data[$u]['interwiki'] = ''; |
179 | 180 | if(!is_null($params['token'])) |
Index: trunk/phase3/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; |
— | — | @@ -272,7 +272,7 @@ |
273 | 273 | * Side effects: error output for invalid access |
274 | 274 | * @return mixed User, UserRightsProxy, or WikiErrorMsg |
275 | 275 | */ |
276 | | - public static function fetchUser( $username ) { |
| 276 | + public function fetchUser( $username ) { |
277 | 277 | global $wgUser, $wgUserrightsInterwikiDelimiter; |
278 | 278 | |
279 | 279 | $parts = explode( $wgUserrightsInterwikiDelimiter, $username ); |