From: hickert Date: Wed, 27 Jun 2007 08:02:34 +0000 (+0000) Subject: Updated dns handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=be3d96f1d4032d0d5bf12cf995d380a4339a9a51;p=gosa.git Updated dns handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6712 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc index 3dbfcec3a..212a41bdc 100644 --- a/plugins/admin/systems/class_servDNSeditZone.inc +++ b/plugins/admin/systems/class_servDNSeditZone.inc @@ -105,15 +105,17 @@ class servdnseditZone extends plugin /* 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"; + + $dots = count(split(".",$this->ReverseZone)); + if($dots == 0){ + $this->NetworkClass = "A"; + $this->ReverseZone .= ".0.0.0"; + }elseif($dots == 1){ + $this->NetworkClass = "B"; + $this->ReverseZone .= ".0.0"; + }else{ + $this->NetworkClass = "C"; + $this->ReverseZone .= ".0"; } } } @@ -499,7 +501,15 @@ class servdnseditZone extends plugin $this->Records [] = $rec; } + $ret['RECORDS'] = $this->Records; + + switch($this->NetworkClass){ + case 'C' : $ret['ReverseZone']= preg_replace("/\.[0-9]*$/","",$this->ReverseZone);break; + case 'B' : $ret['ReverseZone']= preg_replace("/\.[0-9]*\.[0-9]*$/","",$this->ReverseZone);break; + case 'A' : $ret['ReverseZone']= preg_replace("/\.[0-9]*\.[0-9]*\.[0-9]*$/","",$this->ReverseZone);break; + default : trigger_error("Invalid network class given '".$this->NetworkClass."'"); + } $ret['InitialReverseZone']= $this->InitialReverseZone; $ret['InitialzoneName'] = $this->InitialzoneName;