From 527332491fcb8def21063e0399c04cf6ec3f4a55 Mon Sep 17 00:00:00 2001 From: X! Date: Fri, 6 Aug 2010 19:25:34 +0000 Subject: [PATCH] * (bug 24236) Add add, remove, add-self, remove-self tags to meta=siteinfo&siprop=usergroups --- RELEASE-NOTES | 1 + includes/api/ApiQuerySiteinfo.php | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1c5c9c5b97..f88beb57e7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -330,6 +330,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN the timestamp of the last edit * (bug 24677) axto= parameters added to allcategories, allimages, alllinks, allmessages, allpages, and allusers +* (bug 24236) Add add, remove, add-self, remove-self tags to meta=siteinfo&siprop=usergroups === Languages updated in 1.17 === diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index aac8cc4733..53ef290210 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -322,7 +322,8 @@ class ApiQuerySiteinfo extends ApiQueryBase { } protected function appendUserGroups( $property, $numberInGroup ) { - global $wgGroupPermissions; + global $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf; + $data = array(); foreach ( $wgGroupPermissions as $group => $permissions ) { $arr = array( @@ -332,11 +333,25 @@ class ApiQuerySiteinfo extends ApiQueryBase { if ( $numberInGroup ) { $arr['number'] = SiteStats::numberInGroup( $group ); } - + + $groupArr = array( + 'add' => &$wgAddGroups, + 'remove' => &$wgRemoveGroups, + 'add-self' => &$wgGroupsAddToSelf, + 'remove-self' => &$wgGroupsRemoveFromSelf + ); + + foreach( $groupArr as $type => $rights ) { + if( isset( $rights[$group] ) ) { + $arr[$type] = $rights[$group]; + $this->getResult()->setIndexedTagName( $arr[$type], 'group' ); + } + } + $this->getResult()->setIndexedTagName( $arr['rights'], 'permission' ); $data[] = $arr; } - + $this->getResult()->setIndexedTagName( $data, 'group' ); return $this->getResult()->addValue( 'query', $property, $data ); } -- 2.20.1