* (bug 24236) Add add, remove, add-self, remove-self tags to meta=siteinfo&siprop...
authorX! <soxred93@users.mediawiki.org>
Fri, 6 Aug 2010 19:25:34 +0000 (19:25 +0000)
committerX! <soxred93@users.mediawiki.org>
Fri, 6 Aug 2010 19:25:34 +0000 (19:25 +0000)
RELEASE-NOTES
includes/api/ApiQuerySiteinfo.php

index 1c5c9c5..f88beb5 100644 (file)
@@ -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 ===
 
index aac8cc4..53ef290 100644 (file)
@@ -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 );
        }