Index: trunk/phase3/includes/api/ApiQueryUserInfo.php |
— | — | @@ -76,7 +76,9 @@ |
77 | 77 | } |
78 | 78 | |
79 | 79 | if ( isset( $this->prop['groups'] ) ) { |
80 | | - $vals['groups'] = $wgUser->getGroups(); |
| 80 | + $autolist = ApiQueryUsers::getAutoGroups( $wgUser ); |
| 81 | + |
| 82 | + $vals['groups'] = array_merge( $autolist, $wgUser->getGroups() ); |
81 | 83 | $result->setIndexedTagName( $vals['groups'], 'g' ); // even if empty |
82 | 84 | } |
83 | 85 | |
Index: trunk/phase3/includes/api/ApiQueryUsers.php |
— | — | @@ -201,11 +201,7 @@ |
202 | 202 | } |
203 | 203 | } else { |
204 | 204 | if ( isset( $this->prop['groups'] ) && isset( $data[$u]['groups'] ) ) { |
205 | | - $autolist = array(); |
206 | | - $autolist[] = "*"; |
207 | | - foreach( Autopromote::getAutopromoteGroups( User::newFromName( $u ) ) as $group ) { |
208 | | - $autolist[] = $group; |
209 | | - } |
| 205 | + $autolist = ApiQueryUsers::getAutoGroups( User::newFromName( $u ) ); |
210 | 206 | |
211 | 207 | $data[$u]['groups'] = array_merge( $autolist, $data[$u]['groups'] ); |
212 | 208 | |
— | — | @@ -223,7 +219,19 @@ |
224 | 220 | } |
225 | 221 | return $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'user' ); |
226 | 222 | } |
| 223 | + |
| 224 | + public static function getAutoGroups( $user ) { |
| 225 | + $autolist = array(); |
| 226 | + $autolist[] = "*"; |
| 227 | + $autolist[] = "user"; |
227 | 228 | |
| 229 | + foreach( Autopromote::getAutopromoteGroups( $user ) as $group ) { |
| 230 | + $autolist[] = $group; |
| 231 | + } |
| 232 | + |
| 233 | + return $autolist; |
| 234 | + } |
| 235 | + |
228 | 236 | public function getAllowedParams() { |
229 | 237 | return array( |
230 | 238 | 'prop' => array( |
Index: trunk/phase3/includes/specials/SpecialUserrights.php |
— | — | @@ -402,8 +402,9 @@ |
403 | 403 | global $wgOut, $wgUser, $wgLang; |
404 | 404 | |
405 | 405 | $list = array(); |
406 | | - foreach( $groups as $group ) |
| 406 | + foreach( $groups as $group ) { |
407 | 407 | $list[] = self::buildGroupLink( $group ); |
| 408 | + } |
408 | 409 | |
409 | 410 | $autolist = array(); |
410 | 411 | if ( $user instanceof User ) { |