From 95ec6507868936bc07416ab7e4677baef4f959c7 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Fri, 7 Oct 2011 13:58:16 +0000 Subject: [PATCH] Revert r93246: besides the problems pointed out at CR, it also causes bug 31403, wreaking havoc on large wikis --- includes/LogEventsList.php | 10 +++++----- includes/Skin.php | 2 +- includes/api/ApiQueryDeletedrevs.php | 2 +- includes/api/ApiQueryFilearchive.php | 2 +- includes/diff/DifferenceEngine.php | 2 +- includes/specials/SpecialContributions.php | 4 ++-- includes/specials/SpecialDeletedContributions.php | 4 ---- includes/specials/SpecialRevisiondelete.php | 2 -- 8 files changed, 11 insertions(+), 17 deletions(-) diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index d2deeeaf97..5904105865 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -509,7 +509,7 @@ class LogEventsList { } $del = ''; // Don't show useless link to people who cannot hide revisions - if( $wgUser->isAllowed( 'deletedhistory' ) && !$wgUser->isBlocked() ) { + if( $wgUser->isAllowed( 'deletedhistory' ) ) { if( $row->log_deleted || $wgUser->isAllowed( 'deleterevision' ) ) { $canHide = $wgUser->isAllowed( 'deleterevision' ); // If event was hidden from sysops @@ -866,9 +866,9 @@ class LogPager extends ReverseChronologicalPager { $this->mConds['log_user'] = $userid; // Paranoia: avoid brute force searches (bug 17342) $user = $this->getUser(); - if( !$user->isAllowed( 'deletedhistory' ) || $user->isBlocked() ) { + if( !$user->isAllowed( 'deletedhistory' ) ) { $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::DELETED_USER) . ' = 0'; - } elseif( !$user->isAllowed( 'suppressrevision' ) || $user->isBlocked() ) { + } elseif( !$user->isAllowed( 'suppressrevision' ) ) { $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::SUPPRESSED_USER) . ' != ' . LogPage::SUPPRESSED_USER; } @@ -920,9 +920,9 @@ class LogPager extends ReverseChronologicalPager { } // Paranoia: avoid brute force searches (bug 17342) $user = $this->getUser(); - if( !$user->isAllowed( 'deletedhistory' ) || $user->isBlocked() ) { + if( !$user->isAllowed( 'deletedhistory' ) ) { $this->mConds[] = $db->bitAnd('log_deleted', LogPage::DELETED_ACTION) . ' = 0'; - } elseif( !$user->isAllowed( 'suppressrevision' ) || $user->isBlocked() ) { + } elseif( !$user->isAllowed( 'suppressrevision' ) ) { $this->mConds[] = $db->bitAnd('log_deleted', LogPage::SUPPRESSED_ACTION) . ' != ' . LogPage::SUPPRESSED_ACTION; } diff --git a/includes/Skin.php b/includes/Skin.php index 0b02a9849f..5982869a2d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -636,7 +636,7 @@ abstract class Skin extends ContextSource { function getUndeleteLink() { $action = $this->getRequest()->getVal( 'action', 'view' ); - if ( $this->getUser()->isAllowed( 'deletedhistory' ) && !$this->getUser()->isBlocked() && + if ( $this->getUser()->isAllowed( 'deletedhistory' ) && ( $this->getTitle()->getArticleId() == 0 || $action == 'history' ) ) { $n = $this->getTitle()->isDeleted(); diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 3ce962e4da..90a9a986b6 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -43,7 +43,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { public function execute() { global $wgUser; // Before doing anything at all, let's check permissions - if ( !$wgUser->isAllowed( 'deletedhistory' ) || $wgUser->isBlocked() ) { + if ( !$wgUser->isAllowed( 'deletedhistory' ) ) { $this->dieUsage( 'You don\'t have permission to view deleted revision information', 'permissiondenied' ); } diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php index ae386321fe..4f8c095977 100644 --- a/includes/api/ApiQueryFilearchive.php +++ b/includes/api/ApiQueryFilearchive.php @@ -45,7 +45,7 @@ class ApiQueryFilearchive extends ApiQueryBase { public function execute() { global $wgUser; // Before doing anything at all, let's check permissions - if ( !$wgUser->isAllowed( 'deletedhistory' ) || $wgUser->isBlocked() ) { + if ( !$wgUser->isAllowed( 'deletedhistory' ) ) { $this->dieUsage( 'You don\'t have permission to view deleted file information', 'permissiondenied' ); } diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index c08f638442..664fea5d73 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -142,7 +142,7 @@ class DifferenceEngine { */ function deletedLink( $id ) { global $wgUser; - if ( $wgUser->isAllowed( 'deletedhistory' ) && !$wgUser->isBlocked() ) { + if ( $wgUser->isAllowed( 'deletedhistory' ) ) { $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow('archive', '*', array( 'ar_rev_id' => $id ), diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index e88f58b2cc..431787b977 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -311,7 +311,7 @@ class SpecialContributions extends SpecialPage { ); # Add link to deleted user contributions for priviledged users - if( $subject->isAllowed( 'deletedhistory' ) && !$subject->isBlocked() ) { + if( $subject->isAllowed( 'deletedhistory' ) ) { $tools[] = Linker::linkKnown( SpecialPage::getTitleFor( 'DeletedContributions', $username ), wfMsgHtml( 'sp-contributions-deleted' ) @@ -464,7 +464,7 @@ class ContribsPager extends ReverseChronologicalPager { $user = $this->getUser(); $conds = array_merge( $userCond, $this->getNamespaceCond() ); // Paranoia: avoid brute force searches (bug 17342) - if( !$user->isAllowed( 'deletedhistory' ) || $user->isBlocked() ) { + if( !$user->isAllowed( 'deletedhistory' ) ) { $conds[] = $this->mDb->bitAnd('rev_deleted',Revision::DELETED_USER) . ' = 0'; } elseif( !$user->isAllowed( 'suppressrevision' ) ) { $conds[] = $this->mDb->bitAnd('rev_deleted',Revision::SUPPRESSED_USER) . diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index b3fbeb6069..23c0c83260 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -266,10 +266,6 @@ class DeletedContributionsPage extends SpecialPage { return; } - if( $user->isBlocked() ){ - throw new UserBlockedError( $user->getBlock() ); - } - $request = $this->getRequest(); $out = $this->getOutput(); $out->setPageTitle( wfMsgExt( 'deletedcontributions-title', array( 'parsemag' ) ) ); diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index c5915fb3e3..1bfda1ff01 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -118,8 +118,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { throw new PermissionsError( 'deletedhistory' ); } elseif( wfReadOnly() ) { throw new ReadOnlyError; - } elseif( $user->isBlocked() ) { - throw new UserBlockedError( $user->getBlock() ); } $this->mIsAllowed = $user->isAllowed('deleterevision'); // for changes -- 2.20.1