Create cidr.php

This commit is contained in:
FusionPBX
2021-11-26 12:32:19 -07:00
committed by GitHub
parent c4c6524023
commit 9fe891e64c

18
resources/cidr.php Normal file
View File

@@ -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;
}
}
?>