Create cidr.php

This commit is contained in:
FusionPBX 2021-11-26 12:32:19 -07:00 committed by GitHub
parent c4c6524023
commit 9fe891e64c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

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