Code

Updated opsi
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Oct 2008 09:52:23 +0000 (09:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Oct 2008 09:52:23 +0000 (09:52 +0000)
-Allow to send wake event

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12716 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc
gosa-plugins/opsi/admin/opsi/generic.tpl

index 0340f1cd30b8f1cc20759b71431b30e3f1047708..4737d6afc2d82e2e12142f6948e9d997b5bae0ce 100644 (file)
@@ -594,6 +594,9 @@ class opsiGeneric extends plugin
         if($action == "install"){
           $this->install_client(); 
         }
+        if($action == "wake"){
+          $this->wake_client(); 
+        }
       }
 
       /* Get selected netboot product.
@@ -676,6 +679,23 @@ class opsiGeneric extends plugin
   }
 
 
+  /* Wake up client
+   */
+  function wake_client()
+  {
+    /* Check if we are able to communicate with the GOsa supprot daemon
+     */
+    if(class_available("gosaSupportDaemon")){
+      $o = new gosaSupportDaemon();
+      if($o->connect() && class_available("DaemonEvent_wakeup")){
+        $evt = new DaemonEvent_wakeup($this->config);      
+        $evt->add_targets(array($this->mac));
+        $o->append($evt);
+      }
+    }
+  }
+
+
   /* Return plugin informations for acl handling */
   static function plInfo()
   {
index 3e87801576bc827256d51b50915b2d8bfc305c83..139b4e2e03484b1d844baaf32b77f5993250b156 100644 (file)
                {else}
                <option value="install">{t}Install{/t}</option>
                {/if}
+               <option value="wake">{t}Wake{/t}</option>
        </select>
 {render acl=$triggerActionACL}
        <input type='submit' name='opsi_trigger_action' value="{t}Execute{/t}">