Pavel Kosina wrote:
I would like to know how to allow only some ip (local
LAN) to edit. Or
to block some ip`s (all the others) from editing, adding users, comment,
etc. Before placing this question I was really at least 10 minutes
searching at
http://www.mediawiki.org/wiki/MediaWiki.
Thank you
As a userCan hook. Eg.
$wgHooks['userCan'][] = 'LAN_check';
function LAN_check($title, $user, $action, $result)
{
if ($action != 'read') {
if (!preg_match("/^127\.0\./", $_SERVER['REMOTE_ADDR'])) {
$result = false;
return false;
}
}
return true;
}