API: Fix queries for list=allusers&auactiveusers
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 28 Apr 2014 16:03:02 +0000 (12:03 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 30 Jun 2014 16:33:27 +0000 (12:33 -0400)
commiteb4eb3c79888870455819ff10c0e7a3ff4f4b49e
tree9bf9eea475c396b16bb35d2d8c1dce46b0be85b3
parent7b488f64ee6f0ed3ce1c5ede62c25e756a8840e0
API: Fix queries for list=allusers&auactiveusers

The query introduced to support the auactiveusers is itself broken (it
counts every edit multiple times when combined with the group filters or
auprop=groups or auprop=rights, or for users with multiple rows in
ipblocks) and it breaks auprop=groups and auprop=rights.

Instead, let's filter using the same cached data used by
Special:ActiveUsers and do the actual counting of recent "edits" in a
subquery. And for parity with Special:ActiveUsers, let's skip
RC_EXTERNAL when doing the count.

Also, it turns out the "recenteditcount" property in the result is
really more like "recentactions" since it counts any action that shows
up in recentchanges; the discrepancy between that and "editcount" can be
confusing if someone is doing a lot of logged actions that don't create
dummy revisions. Let's rename that, but we'll have to keep the old
property around for a while for BC.

Bug: 64505
Bug: 64507
Bug: 67301
Change-Id: I461e92819188c311cbb3853bc6bfad45962c8d7b
includes/api/ApiQueryAllUsers.php