Code

Updated dns plugin.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Aug 2007 05:00:11 +0000 (05:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Aug 2007 05:00:11 +0000 (05:00 +0000)
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
plugins/admin/systems/class_termDNS.inc

index ac5b3c3b78287fe95f64329abf968c4480c61185..c36446b9dd17634a14644e0607ade517ab66b2e5 100644 (file)
@@ -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);
   }
 
index 52085344260c021228343d77ca7056f6106e7e77..a0f2fd187573796a9db8b75a26a76cb4a98147a4 100644 (file)
@@ -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();