X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUndelete.php;h=05c622a71c6eebd324867088f35312e663417d6e;hb=370bb99a9bb9836286af54856392ecabf09969f7;hp=529c33185e5d51f76e82c9ed56c22b56a8f95c2c;hpb=e5110cdbeabc214f2507f1ce0adb2bb6babb5c87;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 529c33185e..05c622a71c 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -95,7 +95,8 @@ class SpecialUndelete extends SpecialPage { $this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $user->isAllowed( 'suppressrevision' ); $this->mToken = $request->getVal( 'token' ); - if ( $this->isAllowed( 'undelete' ) && !$user->isBlocked() ) { + $block = $user->getBlock(); + if ( $this->isAllowed( 'undelete' ) && !( $block && $block->isSitewide() ) ) { $this->mAllowed = true; // user can restore $this->mCanView = true; // user can view content } elseif ( $this->isAllowed( 'deletedtext' ) ) { @@ -137,8 +138,10 @@ class SpecialUndelete extends SpecialPage { */ protected function isAllowed( $permission, User $user = null ) { $user = $user ?: $this->getUser(); + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + if ( $this->mTargetObj !== null ) { - return $this->mTargetObj->userCan( $permission, $user ); + return $permissionManager->userCan( $permission, $user, $this->mTargetObj ); } else { return $user->isAllowed( $permission ); } @@ -456,7 +459,7 @@ class SpecialUndelete extends SpecialPage { Message::rawParam( $link ), $time, Message::rawParam( $userLink ), $d, $t ); - $out->addHtml( '' ); + $out->addHTML( '' ); if ( !Hooks::run( 'UndeleteShowRevision', [ $this->mTargetObj, $rev ] ) ) { return; @@ -503,7 +506,6 @@ class SpecialUndelete extends SpecialPage { ] ); } else { $sourceView = ''; - $previewButton = ''; } $buttonFields[] = new OOUI\ButtonInputWidget( [ @@ -549,7 +551,6 @@ class SpecialUndelete extends SpecialPage { * * @param Revision $previousRev * @param Revision $currentRev - * @return string HTML */ function showDiff( $previousRev, $currentRev ) { $diffContext = clone $this->getContext(); @@ -688,7 +689,7 @@ class SpecialUndelete extends SpecialPage { $repo = RepoGroup::singleton()->getLocalRepo(); $path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key; - $repo->streamFile( $path ); + $repo->streamFileWithStatus( $path ); } protected function showHistory() {