Revision: 48624
Author:   aaron
Date:     2009-03-20 04:29:49 +0000 (Fri, 20 Mar 2009)

Log Message:
-----------
Don't apply DELETED_USER restriction on query for users with 'suppressrevision'

Modified Paths:
--------------
    trunk/phase3/includes/LogEventsList.php
    trunk/phase3/includes/specials/SpecialContributions.php

Modified: trunk/phase3/includes/LogEventsList.php
===================================================================
--- trunk/phase3/includes/LogEventsList.php     2009-03-20 04:24:40 UTC (rev 
48623)
+++ trunk/phase3/includes/LogEventsList.php     2009-03-20 04:29:49 UTC (rev 
48624)
@@ -573,9 +573,12 @@
                           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 @@
         * @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 @@
                        $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 @@
                        '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;
        }

Modified: trunk/phase3/includes/specials/SpecialContributions.php
===================================================================
--- trunk/phase3/includes/specials/SpecialContributions.php     2009-03-20 
04:24:40 UTC (rev 48623)
+++ trunk/phase3/includes/specials/SpecialContributions.php     2009-03-20 
04:29:49 UTC (rev 48624)
@@ -390,11 +390,14 @@
        }
 
        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(



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to