Create cidr.php
This commit is contained in:
parent
c4c6524023
commit
9fe891e64c
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
//check the domain cidr range
|
||||||
|
if (isset($_SESSION['domain']["cidr"]) && !defined('STDIN')) {
|
||||||
|
$found = false;
|
||||||
|
foreach($_SESSION['domain']["cidr"] as $cidr) {
|
||||||
|
if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$found) {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
Loading…
Reference in New Issue