From: Aaron Schulz Date: Mon, 22 Jun 2009 00:47:23 +0000 (+0000) Subject: Double check against user table to make sure the user exists X-Git-Tag: 1.31.0-rc.0~41249 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=2334634a39e1d4009834f94c2a40ec5a7a595369;p=lhc%2Fweb%2Fwiklou.git Double check against user table to make sure the user exists --- 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;