From 3b6712b831a834573e1875ccb763c49b1fb61c99 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 20 Mar 2009 04:29:49 +0000 Subject: [PATCH] Don't apply DELETED_USER restriction on query for users with 'suppressrevision' --- includes/LogEventsList.php | 14 ++++++++++---- includes/specials/SpecialContributions.php | 7 +++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 7f963a7180..4e07cdb886 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -573,9 +573,12 @@ class LogPager extends ReverseChronologicalPager { but for now it won't pass anywhere behind the optimizer */ $this->mConds[] = "NULL"; } else { + global $wgUser; $this->mConds['log_user'] = $userid; // Paranoia: avoid brute force searches (bug 17342) - $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_USER . ' = 0'; + if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_USER . ' = 0'; + } $this->user = $usertitle->getText(); } } @@ -587,7 +590,7 @@ class LogPager extends ReverseChronologicalPager { * @param $pattern String */ private function limitTitle( $page, $pattern ) { - global $wgMiserMode; + global $wgMiserMode, $wgUser; $title = Title::newFromText( $page ); if( strlen($page) == 0 || !$title instanceof Title ) @@ -617,7 +620,9 @@ class LogPager extends ReverseChronologicalPager { $this->mConds['log_title'] = $title->getDBkey(); } // Paranoia: avoid brute force searches (bug 17342) - $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_ACTION . ' = 0'; + if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + $this->mConds[] = 'log_deleted & ' . LogPage::DELETED_ACTION . ' = 0'; + } } public function getQueryInfo() { @@ -639,7 +644,8 @@ class LogPager extends ReverseChronologicalPager { 'join_conds' => array( 'user' => array( 'INNER JOIN', 'user_id=log_user' ) ), ); - ChangeTags::modifyDisplayQuery( $info['tables'], $info['fields'], $info['conds'], $info['join_conds'], $this->mTagFilter ); + ChangeTags::modifyDisplayQuery( $info['tables'], $info['fields'], $info['conds'], + $info['join_conds'], $this->mTagFilter ); return $info; } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index b14bafa06d..952a261a84 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -390,11 +390,14 @@ class ContribsPager extends ReverseChronologicalPager { } function getQueryInfo() { + global $wgUser; list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond(); $conds = array_merge( $userCond, $this->getNamespaceCond() ); - // Paranoia: avoid brute force searches (bug 17792) - $conds[] = 'rev_deleted & ' . Revision::DELETED_USER . ' = 0'; + // Paranoia: avoid brute force searches (bug 17342) + if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + $conds[] = 'rev_deleted & ' . Revision::DELETED_USER . ' = 0'; + } $join_cond['page'] = array( 'INNER JOIN', 'page_id=rev_page' ); $queryInfo = array( -- 2.20.1