From: John Du Hart Date: Sun, 23 Oct 2011 16:45:08 +0000 (+0000) Subject: Add check to see if the user has permission to view the log. Right now the page title... X-Git-Tag: 1.31.0-rc.0~26949 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=9d8238e55761987459859e76413d929dfdd5d55a;p=lhc%2Fweb%2Fwiklou.git Add check to see if the user has permission to view the log. Right now the page title and description are still set. --- 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', '' ); }