From: hickert Date: Wed, 27 Jun 2007 07:11:57 +0000 (+0000) Subject: Detect network class on dialog load X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3bf52c18b1a778cd462a72a0807759d641de49f1;p=gosa.git Detect network class on dialog load git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6709 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc index c80a4c9b5..1b19fafb3 100644 --- a/plugins/admin/systems/class_servDNSeditZone.inc +++ b/plugins/admin/systems/class_servDNSeditZone.inc @@ -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*/