(bug 19864) Removed overzealous hiding of deleted (but not suppressed) rows from...
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 30 Jul 2009 14:08:25 +0000 (14:08 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 30 Jul 2009 14:08:25 +0000 (14:08 +0000)
includes/LogEventsList.php
includes/LogPage.php
includes/Revision.php
includes/specials/SpecialContributions.php

index 93085d4..a3e4903 100644 (file)
@@ -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;
                }
        }
 
index 9dcefd9..b006eac 100644 (file)
@@ -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 */
index f53dbac..5c3f2cf 100644 (file)
@@ -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;
index 21cb838..84c839a 100644 (file)
@@ -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' );