From 9d8238e55761987459859e76413d929dfdd5d55a Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Sun, 23 Oct 2011 16:45:08 +0000 Subject: [PATCH] Add check to see if the user has permission to view the log. Right now the page title and description are still set. --- includes/specials/SpecialLog.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index 1c4f1d792f..416092d07a 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -35,6 +35,8 @@ class SpecialLog extends SpecialPage { } public function execute( $par ) { + global $wgLogRestrictions; + $this->setHeaders(); $this->outputHeader(); @@ -62,7 +64,13 @@ class SpecialLog extends SpecialPage { $opts->setValue( 'month', '' ); } - if ( !LogPage::isLogType( $opts->getValue( 'type' ) ) ) { + // Reset the log type to default (nothing) if it's invalid or if the + // user does not possess the right to view it + $type = $opts->getValue( 'type' ); + if ( !LogPage::isLogType( $type ) + || ( isset( $wgLogRestrictions[$type] ) + && !$this->getUser()->isAllowed( $wgLogRestrictions[$type] ) ) + ) { $opts->setValue( 'type', '' ); } -- 2.20.1