* Support configuring a permission required to view Special:Unwatchedpages
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Wed, 21 Dec 2005 05:14:40 +0000 (05:14 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Wed, 21 Dec 2005 05:14:40 +0000 (05:14 +0000)
includes/DefaultSettings.php
includes/SpecialUnwatchedpages.php

index 1770080..deb8c37 100644 (file)
@@ -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;
 
index 5ee52b3..738cc27 100644 (file)
@@ -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();