From 7d2ed15a8c85ef6e53959c8248b9c7ac5c3dbd11 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 30 Jul 2009 14:08:25 +0000 Subject: [PATCH] (bug 19864) Removed overzealous hiding of deleted (but not suppressed) rows from log/contribs list from sysops --- includes/LogEventsList.php | 10 ++++++++-- includes/LogPage.php | 3 +++ includes/Revision.php | 3 ++- includes/specials/SpecialContributions.php | 7 +++++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 93085d4e25..a3e49038d8 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -699,8 +699,11 @@ class LogPager extends ReverseChronologicalPager { global $wgUser; $this->mConds['log_user'] = $userid; // Paranoia: avoid brute force searches (bug 17342) - if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + if( !$wgUser->isAllowed( 'deleterevision' ) ) { $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::DELETED_USER) . ' = 0'; + } else if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::SUPPRESSED_USER) . + ' != ' . LogPage::SUPPRESSED_USER; } $this->user = $usertitle->getText(); } @@ -743,8 +746,11 @@ class LogPager extends ReverseChronologicalPager { $this->mConds['log_title'] = $title->getDBkey(); } // Paranoia: avoid brute force searches (bug 17342) - if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + if( !$wgUser->isAllowed( 'deleterevision' ) ) { $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::DELETED_ACTION) . ' = 0'; + } else if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::SUPPRESSED_ACTION) . + ' != ' . LogPage::SUPPRESSED_ACTION; } } diff --git a/includes/LogPage.php b/includes/LogPage.php index 9dcefd9a28..b006eac522 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -34,6 +34,9 @@ class LogPage { const DELETED_COMMENT = 2; const DELETED_USER = 4; const DELETED_RESTRICTED = 8; + // Convenience fields + const SUPPRESSED_USER = 12; + const SUPPRESSED_ACTION = 9; /* @access private */ var $type, $action, $comment, $params, $target, $doer; /* @acess public */ diff --git a/includes/Revision.php b/includes/Revision.php index f53dbac7fd..5c3f2cf898 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -12,7 +12,8 @@ class Revision { const DELETED_COMMENT = 2; const DELETED_USER = 4; const DELETED_RESTRICTED = 8; - + // Convenience field + const SUPPRESSED_USER = 12; // Audience options for Revision::getText() const FOR_PUBLIC = 1; const FOR_THIS_USER = 2; diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 21cb838a58..84c839ae13 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -408,8 +408,11 @@ class ContribsPager extends ReverseChronologicalPager { $conds = array_merge( $userCond, $this->getNamespaceCond() ); // Paranoia: avoid brute force searches (bug 17342) - if( !$wgUser->isAllowed( 'suppressrevision' ) ) { - $conds[] = $this->mDb->bitAnd('rev_deleted', Revision::DELETED_USER) . ' = 0'; + if( !$wgUser->isAllowed( 'deleterevision' ) ) { + $conds[] = $this->mDb->bitAnd('rev_deleted',Revision::DELETED_USER) . ' = 0'; + } else if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + $conds[] = $this->mDb->bitAnd('rev_deleted',Revision::SUPPRESSED_USER) . + ' != ' . Revision::SUPPRESSED_USER; } $join_cond['page'] = array( 'INNER JOIN', 'page_id=rev_page' ); -- 2.20.1