If you know the IP address range, you can just put a snippet in the template for those pages that checks the IP address and forwards those not allowed to an error page.
$user_ip_address = $_SERVER['REMOTE_ADDR'];
if they are using a proxy server, though, you’ll need to use:
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$user_ip_address=$_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$user_ip_address=$_SERVER['REMOTE_ADDR'];
}
The first step, I think, would be to just put:
$user_ip_address = $_SERVER['REMOTE_ADDR'];
echo $user_ip_address;
on a page and have a bunch of people at different machines in the building visit that page and report the results.
Once you know the possible range of IPs, just test to make sure it’s ok, and then, if not, do this:
$url = $modx->makeUrl(##, '', '', 'full');
$modx->sendRedirect($url);
Where ## is set to the url of the document ID of the "sorry, you’re not allowed" page.
Of course, this will kick out your registered users from other IPs, so you’ll have to include them somehow in your test.
Hope this helps,
Bob