瀏覽代碼

Create cidr.php

FusionPBX 3 年之前
父節點
當前提交
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;
+		}
+	}
+ 
+ ?>