X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialContributions.php;h=e8b85fa024a0bb306089b7f239201bcee620daf0;hb=9283760f340c6971d748fb574a35453fa7928807;hp=9d5f430b3c00b2d1b9720a3c28500c774057551d;hpb=5264862bc1224fbb2eec487155aa0253af1fa777;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 9d5f430b3c..e8b85fa024 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -126,7 +126,10 @@ class SpecialContributions extends IncludableSpecialPage { // Allows reverts to have the bot flag in recent changes. It is just here to // be passed in the form at the top of the page - if ( $user->isAllowed( 'markbotedits' ) && $request->getBool( 'bot' ) ) { + if ( MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $user, 'markbotedits' ) && $request->getBool( 'bot' ) + ) { $this->opts['bot'] = '1'; } @@ -213,7 +216,7 @@ class SpecialContributions extends IncludableSpecialPage { 'hideMinor' => $this->opts['hideMinor'], 'nsInvert' => $this->opts['nsInvert'], 'associated' => $this->opts['associated'], - ] ); + ], $this->getLinkRenderer() ); if ( IP::isValidRange( $target ) && !$pager->isQueryableRange( $target ) ) { // Valid range, but outside CIDR limit. @@ -364,6 +367,7 @@ class SpecialContributions extends IncludableSpecialPage { $linkRenderer = $sp->getLinkRenderer(); + $tools = []; # No talk pages for IP ranges. if ( !$isRange ) { $tools['user-talk'] = $linkRenderer->makeLink( @@ -372,7 +376,9 @@ class SpecialContributions extends IncludableSpecialPage { ); } - if ( $sp->getUser()->isAllowed( 'block' ) ) { # Block / Change block / Unblock links + # Block / Change block / Unblock links + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + if ( $permissionManager->userHasRight( $sp->getUser(), 'block' ) ) { if ( $target->getBlock() && $target->getBlock()->getType() != DatabaseBlock::TYPE_AUTO ) { $tools['block'] = $linkRenderer->makeKnownLink( # Change block link SpecialPage::getTitleFor( 'Block', $username ), @@ -399,7 +405,7 @@ class SpecialContributions extends IncludableSpecialPage { ); # Suppression log link (T61120) - if ( $sp->getUser()->isAllowed( 'suppressionlog' ) ) { + if ( $permissionManager->userHasRight( $sp->getUser(), 'suppressionlog' ) ) { $tools['log-suppression'] = $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'Log', 'suppress' ), $sp->msg( 'sp-contributions-suppresslog', $username )->text(), @@ -411,7 +417,7 @@ class SpecialContributions extends IncludableSpecialPage { # Don't show some links for IP ranges if ( !$isRange ) { # Uploads: hide if IPs cannot upload (T220674) - if ( !$isIP || $target->isAllowed( 'upload' ) ) { + if ( !$isIP || $permissionManager->userHasRight( $target, 'upload' ) ) { $tools['uploads'] = $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'Listfiles', $username ), $sp->msg( 'sp-contributions-uploads' )->text() @@ -427,7 +433,7 @@ class SpecialContributions extends IncludableSpecialPage { # Add link to deleted user contributions for priviledged users # Todo: T183457 - if ( $sp->getUser()->isAllowed( 'deletedhistory' ) ) { + if ( $permissionManager->userHasRight( $sp->getUser(), 'deletedhistory' ) ) { $tools['deletedcontribs'] = $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'DeletedContributions', $username ), $sp->msg( 'sp-contributions-deleted', $username )->text() @@ -553,13 +559,9 @@ class SpecialContributions extends IncludableSpecialPage { $filterSelection = Html::rawElement( 'div', [], '' ); } - $labelUsername = Xml::radioLabel( + $labelUsername = Xml::label( $this->msg( 'sp-contributions-username' )->text(), - 'contribs', - 'user', - 'user', - true, - [ 'class' => 'mw-input' ] + 'mw-target-user-or-ip' ); $input = Html::input( 'target', @@ -631,7 +633,10 @@ class SpecialContributions extends IncludableSpecialPage { $filters = []; - if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) { + if ( MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $this->getUser(), 'deletedhistory' ) + ) { $filters[] = Html::rawElement( 'span', [ 'class' => 'mw-input-with-label' ],