merging latest master
[lhc/web/wiklou.git] / includes / api / ApiQueryUsers.php
index acc846b..855e270 100644 (file)
@@ -253,14 +253,16 @@ class ApiQueryUsers extends ApiQueryBase {
        * @return array
        */
        public static function getAutoGroups( $user ) {
+               // FIXME this logic is duplicated from User::getEffectiveGroups(), centralize this
                $groups = array();
                $groups[] = '*';
 
                if ( !$user->isAnon() ) {
                        $groups[] = 'user';
+                       $groups = array_merge( $groups, Autopromote::getAutopromoteGroups( $user ) );
                }
 
-               return array_merge( $groups, Autopromote::getAutopromoteGroups( $user ) );
+               return $groups;
        }
 
        public function getCacheMode( $params ) {