From 62c28328d694b58c528722cd74a9db5ee62f8ebe Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 7 Nov 2006 08:55:02 +0000 Subject: [PATCH] Added Create FAi installation cd patch Template && icon still missing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5028 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_divListSystem.inc | 7 ++++++- plugins/admin/systems/class_systemManagement.inc | 14 ++++++++++++++ plugins/admin/systems/class_termDNS.inc | 13 ++++++------- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index b2d1dd7b3..e4c0e220d 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -52,7 +52,7 @@ class divListSystem extends MultiSelectWindow $this->EnableSaveButton (false); /* Dynamic action col, depending on snapshot icons */ - $action_col_size = 50; + $action_col_size = 60; if($this->parent->snapshotEnabled()){ $action_col_size += 38; } @@ -225,6 +225,11 @@ class divListSystem extends MultiSelectWindow $action2 = ""; } + if(in_array("gotoWorkstation",$val['objectClass'])){ + $action2= "".$action2; + } + if(isset($val['message'])){ $display.= " (".$val['message']." '".$this->config->idepartments[$_SESSION['CurrentMainBase']]."' )"; } diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 0cdbb80b8..5a2b8d834 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -82,6 +82,9 @@ class systems extends plugin }elseif(preg_match("/user_setpwd_.*/i",$key)){ $s_action="change_pw"; $s_entry = preg_replace("/user_setpwd_/i","",$key); + }elseif(preg_match("/gen_cd_.*/i",$key)){ + $s_action="gen_cd"; + $s_entry = preg_replace("/gen_cd_/i","",$key); }elseif(preg_match("/newsystem_.*/i",$key)){ $s_action="newsystem"; $s_entry = preg_replace("/newsystem_/i","",$key); @@ -118,6 +121,17 @@ class systems extends plugin return ($smarty->fetch(get_template_path('chooser.tpl', TRUE))); } + + /******************** + Create FAI CD ... + ********************/ + if ($s_action=="gen_cd"){ + $this->dn= $this->terminals[$s_entry]['dn']; + $_SESSION['objectinfo']= $this->dn; + return ($smarty->fetch(get_template_path('gencd.tpl', TRUE))); + } + + /******************** Create new system ... ********************/ diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 0d570f50e..70d38e0d6 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -310,13 +310,12 @@ class termDNS extends plugin if ($this->ipHostNumber == "" && $this->acl_is_writeable("ipHostNumber")){ $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 @@ -328,7 +327,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 ':'.")); } -- 2.30.2