From 6ac89e8ef5a2483b13e0fecec75d7325bbde868c Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Jun 2007 11:57:35 +0000 Subject: [PATCH] Updated dns git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6723 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDNSeditZone.inc | 14 +++++++++----- plugins/admin/systems/servdnseditzone.tpl | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc index db8554821..b60c9a552 100644 --- a/plugins/admin/systems/class_servDNSeditZone.inc +++ b/plugins/admin/systems/class_servDNSeditZone.inc @@ -77,7 +77,7 @@ class servdnseditZone extends plugin $this->sOAmail = preg_replace("/\./","@",$this->sOAmail,1); $this->sOAmail = preg_replace("/\.$/","",$this->sOAmail); $this->sOAprimary = preg_replace("/\.$/","",$this->sOAprimary); - + $this->zoneName = preg_replace("/\.$/","",$this->zoneName); if(isset($attrs['RECORDS'])){ $this->Records = $attrs['RECORDS']; @@ -330,7 +330,7 @@ class servdnseditZone extends plugin $smarty->assign("Mxrecords", $div->DrawList()); $smarty->assign("records" , $this->generateRecordsList()); $smarty->assign("NetworkClass", $this->NetworkClass); - $smarty->assign("NetworkClasses", array("A"=>"A","B"=>"B","C"=>"C")); + $smarty->assign("NetworkClasses", array("A"=>"255.0.0.0 (Class A)","B"=>"255.255.0.0 (Class B)","C"=>"255.255.255.0 (Class C)")); /* Display tempalte */ $display.= $smarty->fetch(get_template_path('servdnseditzone.tpl', TRUE)); @@ -430,7 +430,7 @@ class servdnseditZone extends plugin if(!is_ip($addr)){ $message[] = _("The given network address is not a valid, please specify a valid IP address."); } - + /* Check if given address matches selected network class */ switch($this->NetworkClass){ case 'A': { @@ -506,8 +506,12 @@ class servdnseditZone extends plugin $ret['InitialzoneName'] = $this->InitialzoneName; $ret['sOAmail'] = preg_replace("/\@/",".",$this->sOAmail); - $ret['sOAmail'] = $ret['sOAmail']."."; - $ret['sOAprimary'] = $ret['sOAprimary']."."; + + foreach(array("sOAprimary","zoneName","sOAmail") as $attr){ + if(!preg_match("/\.$/",$ret[$attr])){ + $ret[$attr] = $ret[$attr]."."; + } + } return($ret); } diff --git a/plugins/admin/systems/servdnseditzone.tpl b/plugins/admin/systems/servdnseditzone.tpl index 99bf1c9c2..702e7717b 100644 --- a/plugins/admin/systems/servdnseditzone.tpl +++ b/plugins/admin/systems/servdnseditzone.tpl @@ -16,7 +16,7 @@ - {t}Network class{/t} + {t}Netmask{/t}