Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -69,6 +69,9 @@ |
70 | 70 | case 'statistics' : |
71 | 71 | $this->appendStatistics($p); |
72 | 72 | break; |
| 73 | + case 'usergroups' : |
| 74 | + $this->appendUserGroups($p); |
| 75 | + break; |
73 | 76 | } |
74 | 77 | } |
75 | 78 | } |
— | — | @@ -224,7 +227,21 @@ |
225 | 228 | $data['jobs'] = intval(SiteStats::jobs()); |
226 | 229 | $this->getResult()->addValue('query', $property, $data); |
227 | 230 | } |
228 | | - |
| 231 | + |
| 232 | + protected function appendUserGroups($property) { |
| 233 | + global $wgGroupPermissions; |
| 234 | + |
| 235 | + $data = array (); |
| 236 | + foreach ($wgGroupPermissions as $group => $permissions) { |
| 237 | + $arr = array ('name' => $group, 'rights' => array_keys($permissions, true)); |
| 238 | + $this->getResult()->setIndexedTagName($arr['rights'], 'permission'); |
| 239 | + $data[] = $arr; |
| 240 | + } |
| 241 | + |
| 242 | + $this->getResult()->setIndexedTagName($data, 'group'); |
| 243 | + $this->getResult()->addValue('query', $property, $data); |
| 244 | + } |
| 245 | + |
229 | 246 | public function getAllowedParams() { |
230 | 247 | return array ( |
231 | 248 | |
— | — | @@ -239,6 +256,7 @@ |
240 | 257 | 'interwikimap', |
241 | 258 | 'dbrepllag', |
242 | 259 | 'statistics', |
| 260 | + 'usergroups', |
243 | 261 | )), |
244 | 262 | |
245 | 263 | 'filteriw' => array ( |
— | — | @@ -262,6 +280,7 @@ |
263 | 281 | ' "statistics" - Returns site statistics', |
264 | 282 | ' "interwikimap" - Returns interwiki map (optionally filtered)', |
265 | 283 | ' "dbrepllag" - Returns database server with the highest replication lag', |
| 284 | + ' "usergroups" - Returns user groups and the associated permissions', |
266 | 285 | ), |
267 | 286 | 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map', |
268 | 287 | 'showalldb' => 'List all database servers, not just the one lagging the most', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -186,6 +186,7 @@ |
187 | 187 | * (bug 13541) Added siprop=specialpagealiases to meta=siteinfo |
188 | 188 | * Added fallback8bitEncoding field to meta=siteinfo&siprop=general output |
189 | 189 | * (bug 13544) Added prop=revid to action=parse |
| 190 | +* (bug 13603) Added siprop=usergroups to meta=siteinfo |
190 | 191 | |
191 | 192 | === Languages updated in 1.13 === |
192 | 193 | |