index 66152454ee4d5897486d193fcde3d90312cdc67e..0f76e2f131c27845aa0b34d3a76e5e868b5aeb6b 100644 (file)
$display= "";
$smarty->assign("staticAddress", "");
+ $smarty->assign("autonet", "");
/* Check for autonet button */
if ($this->autonet && isset($_POST['autonet'])){
}
$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{
$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
/* 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 ':'."));
}
$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
*/