merging latest master
[lhc/web/wiklou.git] / includes / api / ApiQueryUsers.php
index 02fcf01..855e270 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on July 30, 2007
  *
- * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@gmail.com
+ * Copyright © 2007 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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 ) {