Code

renamed opsi function
[gosa.git] / gosa-plugins / opsi / admin / opsi / class_opsi.inc
index 290f39157f27aa3eabf60a3173d44810954d7594..a60ce9085464a6a735a91787dbcceec0a2f2e345 100644 (file)
@@ -57,6 +57,11 @@ class opsi extends gosaSupportDaemon
     $this->target = "00:01:6c:9d:b9:fa";
   }
 
+  
+  public function enabled()
+  {
+    return(TRUE);
+  }
 
   /******************
     Opsi handling 
@@ -90,6 +95,17 @@ class opsi extends gosaSupportDaemon
   }
 
 
+  /*! \brief  Trigger an event like wake or install for a specific hostId. 
+   */
+  public function send_action($type,$hostId,$mac)
+  {
+    switch($type){
+      case 'install'  :  $this->job_opsi_install_client($hostId,$mac); break;
+      default         :  trigger_error('Unknown type '.$type.'.');
+    }
+  }
+
+
   /******************
     SI Communication functions
    ******************/
@@ -404,9 +420,9 @@ class opsi extends gosaSupportDaemon
     @param
     @return            
    */
-  public function job_opsi_install_client($hostId)
+  public function job_opsi_install_client($hostId,$mac)
   {
-    $data = array("hostId" => $hostId);
+    $data = array("hostId" => $hostId,"macaddress"=>$mac);
 
     /* Check parameter */ 
     if(empty($hostId)){
@@ -415,11 +431,7 @@ class opsi extends gosaSupportDaemon
     }
 
     /* Query SI server */
-    $res    = $this->send_data("job_opsi_install_client",$this->target,$data,TRUE);
-    if(isset($res['XML'][0]['ITEM'])){
-      return($res['XML'][0]['ITEM']);
-    }
-    return(array());
+    $this->send_data("job_opsi_install_client",$this->target,$data,TRUE);
   }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: