From: Alex Monk Date: Sat, 13 Oct 2012 14:05:00 +0000 (+0100) Subject: (bug 23721) Only show deletedOnly checkbox on contribs and history if the user can... X-Git-Tag: 1.31.0-rc.0~22037^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=b5a79ed84ce50e41ccfb9478d470b3c5e4d67f72;p=lhc%2Fweb%2Fwiklou.git (bug 23721) Only show deletedOnly checkbox on contribs and history if the user can see deleted entries Change-Id: Id47f2883e22a8742d4e5c322c349743e9101f4a3 --- diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index a2d49e679c..61de3b6328 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -158,8 +158,12 @@ class HistoryAction extends FormlessAction { } else { $conds = array(); } - $checkDeleted = Xml::checkLabel( $this->msg( 'history-show-deleted' )->text(), + if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) { + $checkDeleted = Xml::checkLabel( $this->msg( 'history-show-deleted' )->text(), 'deleted', 'mw-show-deleted-only', $request->getBool( 'deleted' ) ) . "\n"; + } else { + $checkDeleted = ''; + } // Add the general form $action = htmlspecialchars( $wgScript ); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 54f8e26166..ca8c9c8eb4 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -485,8 +485,8 @@ class SpecialContributions extends SpecialPage { ) ) ; - $extraOptions = Xml::tags( 'td', array( 'colspan' => 2 ), - Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), + if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) { + $deletedOnlyCheck = Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), Xml::checkLabel( $this->msg( 'history-show-deleted' )->text(), 'deletedOnly', @@ -494,7 +494,13 @@ class SpecialContributions extends SpecialPage { $this->opts['deletedOnly'], array( 'class' => 'mw-input' ) ) - ) . + ); + } else { + $deletedOnlyCheck = ''; + } + + $extraOptions = Xml::tags( 'td', array( 'colspan' => 2 ), + $deletedOnlyCheck . Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), Xml::checkLabel( $this->msg( 'sp-contributions-toponly' )->text(),