Code

Detect network class on dialog load
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jun 2007 07:11:57 +0000 (07:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jun 2007 07:11:57 +0000 (07:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6709 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDNSeditZone.inc

index c80a4c9b53be730dfdeda6638bebbcf4367a332d..1b19fafb36ba44b634e1d38d23f28fb3cda3ac6c 100644 (file)
@@ -99,6 +99,20 @@ class servdnseditZone extends plugin
         $this->sOAserial = date("Ymd")."01";
       }
     }
+
+    /* Detect Network class */
+    if(!empty($this->ReverseZone)){
+      $addr = preg_replace("/^[^\/]+\//","",$this->ReverseZone);
+      if(preg_match("/^[0-9]*\.0\.0\.0$/",$addr)){
+        $this->NetworkClass = "A";
+      }
+      if(preg_match("/^[0-9]*\.[0-9]*\.0\.0$/",$addr)){
+        $this->NetworkClass = "B";
+      }
+      if(preg_match("/^[0-9]*\.[0-9]*\.[0-9]*\.0$/",$addr)){
+        $this->NetworkClass = "C";
+      }
+    }
   }
 
   /* TRansports the geiven Arraykey one position up*/