Code

Updated System management trigger event
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Oct 2008 09:53:08 +0000 (09:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Oct 2008 09:53:08 +0000 (09:53 +0000)
-Only trigger event for terminals, workstations, opsi and server objects.
-Allow to send opsi wake.

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

gosa-plugins/systems/admin/systems/class_systemManagement.inc

index 67cef2fe6010adb37d152e6910b1d2fca002673b..eacdf888f528bfd15eda7e12de7fa4ffcd0dd5bd 100644 (file)
@@ -722,12 +722,19 @@ class systems extends plugin
       if(count($ids) && class_available("DaemonEvent")){
         $mac= array();
 
+        /* Collect target mac addresses */
         $ldap = $this->config->get_ldap_link();
         foreach($ids as $id){
-          $ldap->cat ($this->terminals[$id]['dn'], array("macAddress"));
-          $attrs= $ldap->fetch();
-          if (isset($attrs['macAddress'][0])){
-            $mac[]= $attrs['macAddress'][0];
+          $type = $this->get_system_type($this->terminals[$id]);
+          if(!in_array($type,array("terminal","server","workstation","opsi_client","winstation "))) continue;
+          if(isset($this->terminals[$id]['macAddress'][0])){
+            $mac[] = $this->terminals[$id]['macAddress'][0];
+          }else{
+            $ldap->cat ($this->terminals[$id]['dn'], array("macAddress"));
+            $attrs= $ldap->fetch();
+            if (isset($attrs['macAddress'][0])){
+              $mac[]= $attrs['macAddress'][0];
+            }
           }
         }
         $events = DaemonEvent::get_event_types(SYSTEM_EVENT);