Exclude external RC entries (e.g. Wikidata) from Special:ActiveUsers
authorBrian Wolff <bawolff+wn@gmail.com>
Thu, 10 Apr 2014 19:31:55 +0000 (16:31 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Thu, 10 Apr 2014 19:37:29 +0000 (16:37 -0300)
People usually want to know who the active users are on the local
wiki, not who edited something on Wikidata.

Note, this changes the query to no longer use a covering index
when joining against the recentchanges table when displaying
the page.

Bug: 63769
Change-Id: I919123f396d0901822108a4675593a2ff5b7307f

includes/specials/SpecialActiveusers.php

index dd6bec2..f739d3b 100644 (file)
@@ -97,7 +97,8 @@ class ActiveUsersPager extends UsersPager {
                        'qcc_type' => 'activeusers',
                        'qcc_namespace' => NS_USER,
                        'user_name = qcc_title',
-                       'rc_user_text = qcc_title'
+                       'rc_user_text = qcc_title',
+                       'rc_type != ' . $dbr->addQuotes( RC_EXTERNAL ) // Don't count wikidata.
                );
                if ( $this->requestedUser != '' ) {
                        $conds[] = 'qcc_title >= ' . $dbr->addQuotes( $this->requestedUser );
@@ -340,6 +341,7 @@ class SpecialActiveUsers extends SpecialPage {
                        array( 'rc_user_text', 'lastedittime' => 'MAX(rc_timestamp)' ),
                        array(
                                'rc_user > 0', // actual accounts
+                               'rc_type != ' . $dbw->addQuotes( RC_EXTERNAL ), // no wikidata
                                'rc_log_type IS NULL OR rc_log_type != ' . $dbw->addQuotes( 'newusers' ),
                                'rc_timestamp >= ' . $dbw->addQuotes( $dbw->timestamp( $sTimestamp ) ),
                                'rc_timestamp <= ' . $dbw->addQuotes( $dbw->timestamp( $eTimestamp ) )