For r58153: in HistoryPage, removed the user permissions checks for deleted revision...
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 9 Feb 2010 01:17:01 +0000 (01:17 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 9 Feb 2010 01:17:01 +0000 (01:17 +0000)
includes/HistoryPage.php
includes/Pager.php

index a9447f1..e515d3d 100644 (file)
@@ -129,23 +129,14 @@ class HistoryPage {
                $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
                /**
                 * Option to show only revisions that have been (partially) hidden via RevisionDelete
-                * Note that this can run a *long* time if there are many revisions to look at.
-                * We use "isBigDeletion" to determine if the history is too big to go through.
-                * Additionally, only users with 'deleterevision' right can filter for deleted edits.
                 */
-               if ( $this->title->userCan( 'deleterevision' )
-                       && ( !$this->article->isBigDeletion() || $this->title->userCan( 'bigdelete' ) ) )
-               {
-                       $conds = ( $wgRequest->getBool( 'deleted' ) )
-                               ? array("rev_deleted != '0'")
-                               : array();
-                       $checkDeleted = Xml::checkLabel( wfMsg( 'history-show-deleted' ),
-                               'deleted', 'mw-show-deleted-only', $wgRequest->getBool( 'deleted' ) ) . "\n";
-               }
-               else { # Don't filter and don't add the checkbox for filtering
+               if ( $wgRequest->getBool( 'deleted' ) ) {
+                       $conds = array("rev_deleted != '0'");
+               } else {
                        $conds = array();
-                       $checkDeleted = '';
                }
+               $checkDeleted = Xml::checkLabel( wfMsg( 'history-show-deleted' ),
+                       'deleted', 'mw-show-deleted-only', $wgRequest->getBool( 'deleted' ) ) . "\n";
 
                $action = htmlspecialchars( $wgScript );
                $wgOut->addHTML(
@@ -325,6 +316,14 @@ class HistoryPager extends ReverseChronologicalPager {
                return $this->historyPage->getArticle();
        }
 
+       function getSqlComment() {
+               if ( $this->conds ) {
+                       return 'history page filtered'; // potentially slow, see CR r58153
+               } else {
+                       return 'history page unfiltered';
+               }
+       }
+
        function getQueryInfo() {
                $queryInfo = array(
                        'tables'  => array('revision'),
index d4aa95d..e5eef1f 100644 (file)
@@ -233,6 +233,13 @@ abstract class IndexPager implements Pager {
                }
        }
 
+       /**
+        * Get some text to go in brackets in the "function name" part of the SQL comment
+        */
+       function getSqlComment() {
+               return get_class( $this );
+       }
+
        /**
         * Do a query with specified parameters, rather than using the object
         * context
@@ -243,7 +250,7 @@ abstract class IndexPager implements Pager {
         * @return ResultWrapper
         */
        function reallyDoQuery( $offset, $limit, $descending ) {
-               $fname = __METHOD__ . ' (' . get_class( $this ) . ')';
+               $fname = __METHOD__ . ' (' . $this->getSqlComment() . ')';
                $info = $this->getQueryInfo();
                $tables = $info['tables'];
                $fields = $info['fields'];