Extension:PublicCat

A lot of the MediaWiki's we maintain at OrganicDesign are mainly for internal document management use for intranets. But often it's convenient to have a single category available publically which looks like a normal website (having none of the usual wiki links for editing and history etc).

This extension divides the site into public and private based on the domain that the requests originate from (we use www.domain for public and wiki.domain for private.

The private domain has all the normal wiki functionality, but is completely inaccessible unless logged in. If not logged in then all requests to the private wiki domain will take you to the login page.

Requests to the public domain results in the usual content but only articles which are members of a specified public category are available and all other requests will result in a 404 not found error. Also only view, raw or render actions are allowed from the public domain, all other actions will be changed to view.

The removal of the wiki content-actions and personal links etc is not handled by this extension, we use Extension:WikiSkin to render the skin aspects conditionally.

Installation
The extension is a single script which you can obtain from OrganicDesign:Extension:PublicCat.php and save into your extensions directory and include in your LocalSettings.php file as in the following example,

Usage
A useful wikitext expression is shown below which allows content to be displayed only if the user is accessing the wiki from the private domain.

Configuration
Configuration of this extension is done via two global variables which can be set in your LocalSettings file after the include of the PublicCat.php script.

Changes

 * 1.0.2 (2007-09-14): fixed warning messages in MW1.11