Extension:InternalWhitelist

From Linux Web Expert

MediaWiki extensions manual
InternalWhitelist
Release status: unmaintained
Implementation User rights
Description Provides the capability to maintain a listing of "whitelisted" articles in the MediaWiki namespace
Author(s) Lisa Ridley, Stanislav Pika
MediaWiki 1.25+
Database changes No
License GNU General Public License 2.0
Download
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').

The InternalWhitelist extension provides the capability to maintain a listing of "whitelisted" articles in the MediaWiki namespace.

For wikis that choose to restrict pages that anonymous users can see, this extension provides the capability of maintaining the "whitelisted" pages from within the MediaWiki application in the MediaWiki namespace. For more information on "whitelisting", please see $wgWhitelistRead .

This extension will actually replace any previously applied settings for $wgWhitelistRead .

Installation & Setup / Changes to LocalSettings.php

  • <translate> <tvar name=1>Download</tvar> and place the file(s) in a directory called <tvar name=name>InternalWhitelist</tvar> in your <tvar name=ext>extensions/</tvar> folder.</translate>
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'InternalWhitelist' );
    $wgGroupPermissions['*']['read'] = false;
    
  • Create a page titled "MediaWiki:Whitelist". List each page you wish to "whitelist" for anonymous users as a bulleted list. Comments can be added to the page by preceding each line that is a comment with a double slash ("//"). For example, to whitelist the Main Page, the discussion page for the Main Page, and the Recent Changes page, you would enter the following content in MediaWiki:Whitelist:
//Whitelisted pages
//Subject pages
* Main Page
//Discussion pages
* Talk:Main Page
//Special Pages
* Special:RecentChanges

The lines starting with "//" will be ignored, and the bulleted lines will become an array of whitelisted pages.

Notes

If you are currently maintaining a whitelist in your LocalSettings.php script file, this listing will be discarded and replaced with the pages listed on MediaWiki:Whitelist. If you install this extension and do not create MediaWiki:Whitelist then all pages except Special:Userlogin will be unavailable to anonymous visitors.

It is not necessary to set $wgGroupPermissions['*']['read'] = false; in the LocalSettings.php file as this extension will set those permissions during the initialization process; however it is good practice to keep your Group Permissions settings in one place for ease of maintenance.

Only "//" will work properly for commented lines.

Download the extension by using git on the command-line:

cd $IP/extensions
sudo git clone https://github.com/staspika/mediawiki-internalwhitelist.git InternalWhitelist

See also