Code

Corrected FAQ
[gosa.git] / plugins / admin / systems / class_termDNS.inc
index 66152454ee4d5897486d193fcde3d90312cdc67e..0f76e2f131c27845aa0b34d3a76e5e868b5aeb6b 100644 (file)
@@ -121,6 +121,7 @@ class termDNS extends plugin
     $display= "";
 
     $smarty->assign("staticAddress", ""); 
+    $smarty->assign("autonet", "");
  
     /* Check for autonet button */
     if ($this->autonet && isset($_POST['autonet'])){
@@ -155,11 +156,7 @@ class termDNS extends plugin
       }
       $smarty->assign("staticAddress","<font class=\"must\">*</font>");
 
-      if ($this->autonet){
-        $smarty->assign("autonet", "true");
-      } else {
-        $smarty->assign("autonet", "");
-      }
+      $smarty->assign("autonet", $this->autonet);
       $display.= $smarty->fetch(get_template_path('network.tpl', TRUE));
       return($display);
     }else{
@@ -297,12 +294,11 @@ class termDNS extends plugin
         $message[]= _("The required field 'IP-address' is not set.");
       }
 
-      /* check if given ip is valid ipi
-       */
-      $num="(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
-      if (!preg_match("/^$num\\.$num\\.$num\\.$num$/", $this->ipHostNumber)){
-        $message[]= _("Wrong IP format in field IP-address.");
-      }
+    }
+
+    /* check if given ip is valid ip */
+    if ($this->ipHostNumber != "" && !is_ip($this->ipHostNumber)){
+      $message[]= _("Wrong IP format in field IP-address.");
     }
 
     /* Check if mac is empty 
@@ -313,8 +309,7 @@ class termDNS extends plugin
 
     /* Check if given mac is valid mac 
      */
-    $tr = count(split(":",$this->macAddress));
-    if($tr!=6){
+    if(!is_mac($this->macAddress)){
       $message[]=(_("The given macaddress is invalid. There must be 6 2byte segments seperated by ':'."));
     }
 
@@ -324,7 +319,8 @@ class termDNS extends plugin
       $checkArray = array();
       $onlyOnce   = array();
 
-      $onlyOnce['cNAMERecord'] = 0;
+                       // There can be many CNAME records
+      //$onlyOnce['cNAMERecord'] = 0;
 
       /* Walk through all entries and detect duplicates or mismatches
        */