mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Update the settings domain cidr
Replace $_SESSION['domain']['cidr'] with settings->get('domain', 'cidr')
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Portions created by the Initial Developer are Copyright (C) 20018-2021
|
Portions created by the Initial Developer are Copyright (C) 20018-2025
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -25,16 +25,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//check the domain cidr range
|
//check the domain cidr range
|
||||||
if (isset($_SESSION['domain']["cidr"]) && !defined('STDIN')) {
|
global $settings;
|
||||||
|
if (!defined('STDIN') && !empty($settings->get('domain', 'cidr'))) {
|
||||||
$found = false;
|
$found = false;
|
||||||
if (!empty($_SESSION['domain']["cidr"])) {
|
$cidr_array = $settings->get('domain', 'cidr');
|
||||||
foreach($_SESSION['domain']["cidr"] as $cidr) {
|
if (!empty($cidr_array)) {
|
||||||
|
foreach($cidr_array as $cidr) {
|
||||||
if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
|
if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($cidr);
|
|
||||||
}
|
}
|
||||||
if (!$found) {
|
if (!$found) {
|
||||||
echo "access denied";
|
echo "access denied";
|
||||||
|
|||||||
Reference in New Issue
Block a user