FusionPBX 3 жил өмнө
parent
commit
98c9c4829e
1 өөрчлөгдсөн 18 нэмэгдсэн , 0 устгасан
  1. 18 0
      resources/cidr.php

+ 18 - 0
resources/cidr.php

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