From 2334634a39e1d4009834f94c2a40ec5a7a595369 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 22 Jun 2009 00:47:23 +0000 Subject: [PATCH] Double check against user table to make sure the user exists --- includes/specials/SpecialActiveusers.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index d6418a0028..0fbb183404 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -53,26 +53,25 @@ class ActiveUsersPager extends UsersPager { function getQueryInfo() { $dbr = wfGetDB( DB_SLAVE ); - $conds = array(); - // don't show hidden names - $conds[] = 'ipb_deleted IS NULL'; + $conds = array('rc_user > 0'); // Users - no anons + $conds[] = 'ipb_deleted IS NULL'; // don't show hidden names $useIndex = $dbr->useIndexClause('rc_user_text'); if( $this->requestedUser != "" ) { $conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser ); } - $conds[] = 'rc_user > 0'; // Users - no anons - list ($recentchanges,$ipblocks) = $dbr->tableNamesN('recentchanges','ipblocks'); + list ($recentchanges,$ipblocks,$user) = $dbr->tableNamesN('recentchanges','ipblocks','user'); $query = array( 'tables' => " $recentchanges $useIndex - LEFT JOIN $ipblocks ON rc_user=ipb_user AND ipb_auto=0 AND ipb_deleted=1 ", + LEFT JOIN $ipblocks ON rc_user=ipb_user AND ipb_auto=0 AND ipb_deleted=1 + INNER JOIN $user ON rc_user=user_id ", 'fields' => array('rc_user_text AS user_name', // inheritance 'rc_user_text', // for Pager 'MAX(rc_user) AS user_id', 'COUNT(*) AS recentedits', 'MAX(ipb_user) AS blocked'), - 'options' => array('GROUP BY' => 'user_name'), + 'options' => array('GROUP BY' => 'rc_user_text'), 'conds' => $conds ); return $query; -- 2.20.1