Explorar o código

Create cidr.php

FusionPBX %!s(int64=3) %!d(string=hai) anos
pai
achega
98c9c4829e
Modificáronse 1 ficheiros con 18 adicións e 0 borrados
  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;
+		}
+	}
+ 
+ ?>