From 30dc38b4f8a6ad5cce0e88953f43f376137451c1 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 28 Aug 2007 05:00:11 +0000 Subject: [PATCH] Updated dns plugin. Don't add a dot after ip addresses. Automatically add ns record. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7148 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDNSeditZone.inc | 8 +++++++- plugins/admin/systems/class_termDNS.inc | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc index ac5b3c3b7..c36446b9d 100644 --- a/plugins/admin/systems/class_servDNSeditZone.inc +++ b/plugins/admin/systems/class_servDNSeditZone.inc @@ -88,6 +88,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); @@ -515,10 +518,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); } diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 520853442..a0f2fd187 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -789,7 +789,7 @@ class termDNS extends plugin /* this function returns the default ptr record entry */ function get_pTRRecord() { - if(!empty($this->ipHostNumber) && isset($this->dnsEntry['zoneName'])){ + if(!empty($this->ipHostNumber) && isset($this->dnsEntry['zoneName']) && !empty($this->dnsEntry['zoneName'])){ $ldap = $this->config->get_ldap_link(); $ldap->cat(getDNSZoneDN($this->config,$this->dnsEntry['zoneName'])); $attrs = $ldap->fetch(); -- 2.30.2