Fix bug causing API to list anons as autoconfirmed in certain cases
authorCatrope <roan.kattouw@gmail.com>
Thu, 2 Aug 2012 20:48:49 +0000 (13:48 -0700)
committerCatrope <roan.kattouw@gmail.com>
Thu, 2 Aug 2012 20:48:49 +0000 (13:48 -0700)
commit2a55449257b6a8b7e259cd8f5208b4734bd312d2
treea26fd317e116745b5790972617197068443c7b5d
parentb57a4db07b5f55858535799c7c6c8d409206ad4a
Fix bug causing API to list anons as autoconfirmed in certain cases

On a stock install, the autoconfirmed requirements default to zero, so
anons qualify for autoconfirmed. They don't actually get it because
User::getEffectiveGroups() only checks for autopromote groups for
logged-in users. However, ApiQueryUsers::getAutoGroups() (which
duplicates this logic for some reason) didn't use the same rule and
applied autopromote groups to anons too, which caused discrepancies
betwen the API output and wgUserGroups.

Krinkle noticed this because a QUnit test for mw.user.getGroups() was
failing while logged out: the API response included autoconfirmed but
wgUserGroups didn't.

Change-Id: I0b781c11e06d3cc7176b2fb3ba06979d3637f970
includes/api/ApiQueryUsers.php