From: Ævar Arnfjörð Bjarmason Date: Wed, 21 Dec 2005 05:14:40 +0000 (+0000) Subject: * Support configuring a permission required to view Special:Unwatchedpages X-Git-Tag: 1.6.0~914 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=5410fd6f5c6a5378384bbe7c883b25832ecff936;p=lhc%2Fweb%2Fwiklou.git * Support configuring a permission required to view Special:Unwatchedpages --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 1770080b98..deb8c37742 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1394,6 +1394,12 @@ $wgExtraRandompageSQL = false; */ $wgEnableUnwatchedpages = false; +/** + * Users must have this permission to view Special:Unwatchedpages, e.g. + * 'protect' for only allowing >sysops. '' for none + */ +$wgUnwatchedPagesPermission = ''; + /** Allow the "info" action, very inefficient at the moment */ $wgAllowPageInfo = false; diff --git a/includes/SpecialUnwatchedpages.php b/includes/SpecialUnwatchedpages.php index 5ee52b3f6b..738cc278e3 100644 --- a/includes/SpecialUnwatchedpages.php +++ b/includes/SpecialUnwatchedpages.php @@ -57,6 +57,11 @@ class UnwatchedpagesPage extends QueryPage { * constructor */ function wfSpecialUnwatchedpages() { + global $wgUser, $wgUnwatchedPagesPermission, $wgOut; + + if ( ! $wgUser->isAllowed( $wgUnwatchedPagesPermission ) ) + return $wgOut->permissionRequired( $wgUnwatchedPagesPermission ); + list( $limit, $offset ) = wfCheckLimits(); $wpp = new UnwatchedpagesPage();