X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUndelete.php;h=d3d3bd7b06dde16d627230216c5bbb7b17729e71;hp=075b5df0c20001bc832f40a6525b1fb9238e0a6e;hb=a1ef77b2d80830fbcb617a83961d78cff9d6e384;hpb=a389d94551f1ece9112c66bf8a53f66d3c15c0b2 diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 075b5df0c2..d3d3bd7b06 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -33,18 +33,28 @@ use Wikimedia\Rdbms\IResultWrapper; * @ingroup SpecialPage */ class SpecialUndelete extends SpecialPage { - private $mAction; - private $mTarget; - private $mTimestamp; - private $mRestore; - private $mRevdel; - private $mInvert; - private $mFilename; - private $mTargetTimestamp; - private $mAllowed; - private $mCanView; - private $mComment; - private $mToken; + private $mAction; + private $mTarget; + private $mTimestamp; + private $mRestore; + private $mRevdel; + private $mInvert; + private $mFilename; + private $mTargetTimestamp; + private $mAllowed; + private $mCanView; + private $mComment; + private $mToken; + /** @var bool|null */ + private $mPreview; + /** @var bool|null */ + private $mDiff; + /** @var bool|null */ + private $mDiffOnly; + /** @var bool|null */ + private $mUnsuppress; + /** @var int[]|null */ + private $mFileVersions; /** @var Title */ private $mTargetObj; @@ -92,7 +102,9 @@ class SpecialUndelete extends SpecialPage { $this->mDiff = $request->getCheck( 'diff' ); $this->mDiffOnly = $request->getBool( 'diffonly', $this->getUser()->getOption( 'diffonly' ) ); $this->mComment = $request->getText( 'wpComment' ); - $this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $user->isAllowed( 'suppressrevision' ); + $this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $user, 'suppressrevision' ); $this->mToken = $request->getVal( 'token' ); $block = $user->getBlock(); @@ -143,7 +155,7 @@ class SpecialUndelete extends SpecialPage { if ( $this->mTargetObj !== null ) { return $permissionManager->userCan( $permission, $user, $this->mTargetObj ); } else { - return $user->isAllowed( $permission ); + return $permissionManager->userHasRight( $user, $permission ); } } @@ -169,7 +181,10 @@ class SpecialUndelete extends SpecialPage { $out->addWikiMsg( 'undelete-header' ); # Not all users can just browse every deleted page from the list - if ( $user->isAllowed( 'browsearchive' ) ) { + if ( MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $user, 'browsearchive' ) + ) { $this->showSearchForm(); } @@ -764,7 +779,8 @@ class SpecialUndelete extends SpecialPage { LogEventsList::showLogExtract( $out, 'delete', $this->mTargetObj ); # Show relevant lines from the suppression log: $suppressLogPage = new LogPage( 'suppress' ); - if ( $this->getUser()->isAllowed( 'suppressionlog' ) ) { + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + if ( $permissionManager->userHasRight( $this->getUser(), 'suppressionlog' ) ) { $out->addHTML( Xml::element( 'h2', null, $suppressLogPage->getName()->text() ) . "\n" ); LogEventsList::showLogExtract( $out, 'suppress', $this->mTargetObj ); } @@ -816,7 +832,7 @@ class SpecialUndelete extends SpecialPage { ] ) ); - if ( $this->getUser()->isAllowed( 'suppressrevision' ) ) { + if ( $permissionManager->userHasRight( $this->getUser(), 'suppressrevision' ) ) { $fields[] = new OOUI\FieldLayout( new OOUI\CheckboxInputWidget( [ 'name' => 'wpUnsuppress', @@ -856,7 +872,7 @@ class SpecialUndelete extends SpecialPage { if ( $haveRevisions ) { # Show the page's stored (deleted) history - if ( $this->getUser()->isAllowed( 'deleterevision' ) ) { + if ( $permissionManager->userHasRight( $this->getUser(), 'deleterevision' ) ) { $history .= Html::element( 'button', [