From: hickert Date: Tue, 28 Aug 2007 13:55:19 +0000 (+0000) Subject: Updated trunk dns plugins. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2fead6d532412027d9f9ef9fbc751d96e6b9170f;p=gosa.git Updated trunk dns plugins. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7157 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions_dns.inc b/include/functions_dns.inc index f24ec3247..42f051964 100644 --- a/include/functions_dns.inc +++ b/include/functions_dns.inc @@ -247,6 +247,7 @@ function getDNSZoneEntriesDiff($config,$newZones,$HostDn) $soa.=" ".$zone[$attr]; } $obj['sOARecord'] = trim($soa); + $obj['nSRecord'] = $zone['sOAprimary']; /* If reverse zone was renamed, move entry */ @@ -273,6 +274,9 @@ function getDNSZoneEntriesDiff($config,$newZones,$HostDn) /* Add new Records */ foreach($zone['RECORDS'] as $rec){ + if(!isset($obj[$rec['type']])||!is_array($obj[$rec['type']])){ + $obj[$rec['type']] = array(); + } $obj[$rec['type']][] = $rec['value']; } @@ -567,7 +571,7 @@ function getDNSHostEntriesDiff($config,$oldName,$newEntry,$newName) $ptrObj = $baseObj; $reverseName = getNameFromMix($reverseNameMix); $ptrObj['zoneName'] = $reverseName; - $ptrObj['pTRRecord'] = $newName.".".$zoneName."."; + $ptrObj['pTRRecord'] = preg_replace("/\.\.$/",".",$newName.".".$zoneName."."); $ptrObj['relativeDomainName'] = $rec['value']; $add[$PTRdn] = $ptrObj; diff --git a/plugins/admin/systems/class_servDNS.inc b/plugins/admin/systems/class_servDNS.inc index d2ebb5d8e..34af08f03 100644 --- a/plugins/admin/systems/class_servDNS.inc +++ b/plugins/admin/systems/class_servDNS.inc @@ -157,6 +157,13 @@ class servdns extends goService } } + if(isset($_GET['act']) && $_GET['act'] == "edit" && isset($_GET['id'])){ + $id = base64_decode($_GET['id']); + if(isset($this->Zones[$id])){ + $this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$id]); + } + } + /* Show dialog */ if($this->dialog!= NULL){ @@ -177,10 +184,9 @@ class servdns extends goService $link = "%s"; foreach($this->Zones as $zone => $values ){ - $ZoneList->AddEntry(array( - array("string" => sprintf($link,base64_encode($zone),$zone)), - array("string" => sprintf($link,base64_encode($zone),_("Reverse zone")." : ".$values['ReverseZone'])), + array("string" => sprintf($link,base64_encode($zone),($zone))), + array("string" => sprintf($link,base64_encode($zone),_("Reverse zone")." : ".($values['ReverseZone']))), array("string" => _("TTL")." : ".$values['sOAttl']), array("string" => _("Class")." : ".$values['dNSClass']), array("string" =>str_replace("%s",base64_encode($zone),$editImg)) diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc index af3803fe2..500739c2d 100644 --- a/plugins/admin/systems/class_servDNSeditZone.inc +++ b/plugins/admin/systems/class_servDNSeditZone.inc @@ -91,6 +91,9 @@ class servdnseditZone extends plugin $tmp2[$tmp[0]] = $rec; unset($this->Records[$key]); } + if($rec['type'] == "nSRecord"){ + unset($this->Records[$key]); + } } if(count($tmp2) != 0){ reset($tmp2); @@ -424,8 +427,8 @@ class servdnseditZone extends plugin } /* Check class for given Zone Address */ - $addr = preg_replace("/^[^\/]+\//","",$this->ReverseZone); - + $addr = preg_replace("/^[^\/]*+\//","",$this->ReverseZone); + /* Check for valid&complete IP address */ if(!is_ip($addr)){ $message[] = _("The given network address is not a valid, please specify a valid IP address."); @@ -509,10 +512,13 @@ class servdnseditZone extends plugin foreach(array("sOAprimary","zoneName","sOAmail") as $attr){ if(!preg_match("/\.$/",$ret[$attr])){ - $ret[$attr] = $ret[$attr]."."; + if(!is_ip($ret[$attr])){ + $ret[$attr] = $ret[$attr]."."; + } } } + $ret['RECORDS'][] = array("type" => "nSRecord","value" => $ret['sOAprimary']) ; return($ret); }