Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | $fit = $this->appendStatistics( $p ); |
74 | 74 | break; |
75 | 75 | case 'usergroups': |
76 | | - $fit = $this->appendUserGroups( $p ); |
| 76 | + $fit = $this->appendUserGroups( $p, $params['numberingroup'] ); |
77 | 77 | break; |
78 | 78 | case 'extensions': |
79 | 79 | $fit = $this->appendExtensions( $p ); |
— | — | @@ -316,11 +316,17 @@ |
317 | 317 | return $this->getResult()->addValue( 'query', $property, $data ); |
318 | 318 | } |
319 | 319 | |
320 | | - protected function appendUserGroups( $property ) { |
| 320 | + protected function appendUserGroups( $property, $numberInGroup ) { |
321 | 321 | global $wgGroupPermissions; |
322 | 322 | $data = array(); |
323 | 323 | foreach( $wgGroupPermissions as $group => $permissions ) { |
324 | | - $arr = array( 'name' => $group, 'rights' => array_keys( $permissions, true ) ); |
| 324 | + $arr = array( |
| 325 | + 'name' => $group, |
| 326 | + 'rights' => array_keys( $permissions, true ), |
| 327 | + ); |
| 328 | + if ( $numberInGroup ) |
| 329 | + $arr['number'] = SiteStats::numberInGroup( $group ); |
| 330 | + |
325 | 331 | $this->getResult()->setIndexedTagName( $arr['rights'], 'permission' ); |
326 | 332 | $data[] = $arr; |
327 | 333 | } |
— | — | @@ -431,6 +437,7 @@ |
432 | 438 | ) |
433 | 439 | ), |
434 | 440 | 'showalldb' => false, |
| 441 | + 'numberingroup' => false, |
435 | 442 | ); |
436 | 443 | } |
437 | 444 | |
— | — | @@ -454,6 +461,7 @@ |
455 | 462 | ), |
456 | 463 | 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map', |
457 | 464 | 'showalldb' => 'List all database servers, not just the one lagging the most', |
| 465 | + 'numberingroup' => 'Lists the number of users in user groups', |
458 | 466 | ); |
459 | 467 | } |
460 | 468 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -285,6 +285,7 @@ |
286 | 286 | * (bug 19423) The initial file description page used caption in user lang |
287 | 287 | rather than UI lang |
288 | 288 | * Added snippet field to list=search output |
| 289 | +* (bug 17809) Add number of users in user groups to meta=siteinfo |
289 | 290 | |
290 | 291 | === Languages updated in 1.16 === |
291 | 292 | |