mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Remove cidr from the pdo.php file.
This was an awkward place for this code so moved it into its own include.
This commit is contained in:
@@ -347,35 +347,4 @@ if ($db_type == "pgsql") {
|
||||
$domain_uuid = uuid();
|
||||
}
|
||||
|
||||
//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;
|
||||
}
|
||||
}
|
||||
|
||||
//check the api cidr range
|
||||
if (isset($_SESSION['api']["cidr"])) {
|
||||
$found = false;
|
||||
foreach($_SESSION['api']["cidr"] as $cidr) {
|
||||
if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
unset ($_REQUEST['key']);
|
||||
unset ($_POST['key']);
|
||||
unset ($_GET['key']);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user