Extension:PublicCat.php
<?php
- Extension:PublicCat
- - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
- - Author: User:NadCategory:Extensions created with Template:Extension
if (!defined('MEDIAWIKI')) die('Not an entry point.');
define('PUBLICCAT_VERSION','1.0.0, 2007-06-16');
$wgExtensionFunctions[] = 'wfSetupPublicCat'; $wgHooks['LanguageGetMagic'][] = 'wfPublicCatLanguageGetMagic';
- Anonymous users
$wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['*']['read'] = false; $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createpage'] = false; $wgGroupPermissions['*']['createtalk'] = false; $wgWhitelistRead = array('Special:Userlogin','Main Page','-');
$wgExtensionCredits['other'][] = array( 'name' => 'PublicCat', 'author' => 'User:Nad', 'description' => 'Divides wiki into private and public by domain name, but allows unrestricted access to articles in a public category.', 'url' => 'http://www.mediawiki.org/wiki/Extension:PublicCat', 'version' => PUBLICCAT_VERSION );
if (!ereg('^wiki.',$_SERVER['HTTP_HOST'])) { if ($_REQUEST['action'] != 'view' && $_REQUEST['action'] != 'raw') $_REQUEST['action'] = 'view'; }
- Called from $wgExtensionFunctions array when initialising extensions
function wfSetupPublicCat() { }
function wf404() { header('HTTP/1.0 404 Not Found'); $err = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</t$
<body>
Not Found
The requested URL was not found on this server.
</body>$
if (in_array('Content-Encoding: gzip',headers_list())) $err = gzencode($err); echo $err; die; }
?>