Code

Updated strings in dhcp error msgs
[gosa.git] / plugins / admin / systems / class_servDNSeditZone.inc
index ac5b3c3b78287fe95f64329abf968c4480c61185..02a887407c8096cd61d60eff0d1c173277805aad 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);
@@ -207,6 +210,7 @@ class servdnseditZone extends plugin
       $smarty->assign("AllowZoneEdit" , true);
       if(isset($_POST['EditZoneEntries'])){
         $this->dialog= new servDNSeditZoneEntries($this->config,$this->dn,$this->ZoneObject);
+        $this->dialog->parent = $this;
       }
     }
 
@@ -221,6 +225,11 @@ class servdnseditZone extends plugin
         }
       }else{
         $this->dialog->save();
+        $rev = FlipIp(getNameFromMix($this->InitialReverseZone)).".in-addr.arpa";
+        $for = getNameFromMix($this->InitialzoneName);
+       
+        $this->parent->handle_post_events("modify",array("dn" => $this->dn,"zoneName" => $rev));
+        $this->parent->handle_post_events("modify",array("dn" => $this->dn,"zoneName" => $for));
         $this->dialog = false;
       }
     }
@@ -515,10 +524,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);
   }