Code

Updated opsi activation .
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Dec 2008 13:48:38 +0000 (13:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Dec 2008 13:48:38 +0000 (13:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13319 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 92d622deb5dd38fa15d32607b20a9ef500f3d2ad..b0ea92bdf24951998b305565a2e5d495d24f7081 100644 (file)
@@ -141,6 +141,23 @@ class opsi extends gosaSupportDaemon
     }
   }
 
+  
+  public function job_opsi_activate_client($id,$mac)
+  {
+    $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
+    $o_queue = new gosaSupportDaemon();
+    if(isset($events['TRIGGERED']['DaemonEvent_activate'])){
+      $evt = $events['TRIGGERED']['DaemonEvent_activate'];
+      $tmp = new $evt['CLASS_NAME']($this->config);
+      $tmp->set_type(TRIGGERED_EVENT);
+      $tmp->add_targets(array($mac));
+      if(!$o_queue->append($tmp)){
+        msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
+      }
+    }
+  }
+
+
 
   /******************
     SI Communication functions
index 8fcbf72dbd678f1ae29bdcb817cf92600eeb0570..722af8e4c6e196be3de32a2c4ca77929452a257e 100644 (file)
@@ -1010,6 +1010,11 @@ class systems extends plugin
           $ldap->cd($this->config->current['BASE']);
           $ldap->rmdir ($this->systab->dn);
           @DEBUG(DEBUG_LDAP,__LINE__, __FUNCTION__, __FILE__,"Source removed: ".$this->systab->dn,"Opsi host activated.");
+
+          $hostId =  $this->systab->by_object['opsiGeneric']->hostId;
+          $mac    =  $this->systab->by_object['opsiGeneric']->mac;
+          $this->opsi->job_opsi_activate_client($hostId,$mac);
+
         }elseif(isset($this->systab->was_activated) && $this->systab->was_activated){
           $this->activate_new_device($this->systab->dn);
         }