Code

Added Create FAi installation cd patch
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Nov 2006 08:55:02 +0000 (08:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Nov 2006 08:55:02 +0000 (08:55 +0000)
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
plugins/admin/systems/class_systemManagement.inc
plugins/admin/systems/class_termDNS.inc

index b2d1dd7b31c1fa3e6f4d1e1e13365566b5e7f782..e4c0e220df9e69966ada4449bf9420546aac11dd 100644 (file)
@@ -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= "<input class='center' type='image' src='images/cdrom.png' alt='"._("Create CD")."'   
+                      name='gen_cd_%KEY%' title='"._("Create FAI CD")."'>".$action2;
+      }
+
       if(isset($val['message'])){
         $display.= "  (".$val['message']." '".$this->config->idepartments[$_SESSION['CurrentMainBase']]."'  )";
       }
index 0cdbb80b8be8f2d81f63561cd0234c001202c9bd..5a2b8d8345fe57a9fc66783c98563618b84efac6 100644 (file)
@@ -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 ...   
      ********************/
index 0d570f50ef51f6edb22c32b157e5b7e9d3a5a22c..70d38e0d60dd88d6ec9f0ca308f956dbc1c2482c 100644 (file)
@@ -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 ':'."));
     }