From 3bf52c18b1a778cd462a72a0807759d641de49f1 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Jun 2007 07:11:57 +0000 Subject: [PATCH] Detect network class on dialog load git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6709 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDNSeditZone.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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*/ -- 2.30.2