From 0e415b91e54cfece220bf887978779cf60e0d201 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 19 Jun 2009 08:59:13 +0000 Subject: [PATCH] Added a check to the dns service which ensures that we do not use reverse zones twice. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13738 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/dns/class_servDNSeditZone.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc index 695aa5e52..b61601c6e 100644 --- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc +++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc @@ -453,6 +453,21 @@ class servdnseditZone extends plugin if(!tests::is_ip($addr)){ $message[] = msgPool::invalid(_("Network address")); } + + // Ensure that we do not use reverse zones twice. + // this currently not supported by GOsa. + $zones = DNS::getDNSZoneEntries($this->config,$this->dn); + switch($this->NetworkClass){ + case 'C' : $test = preg_replace("/\.[0-9]*$/","",$this->ReverseZone);break; + case 'B' : $test = preg_replace("/\.[0-9]*\.[0-9]*$/","",$this->ReverseZone);break; + case 'A' : $test = preg_replace("/\.[0-9]*\.[0-9]*\.[0-9]*$/","",$this->ReverseZone);break; + default : trigger_error("Invalid network class given '".$this->NetworkClass."'"); + } + foreach($zones as $name => $data){ + if($data['ReverseZone'] == $test){ + $message[] = msgPool::duplicated(_("Network address")); + } + } /* Check if given address matches selected network class */ switch($this->NetworkClass){ -- 2.30.2