Code

Apply patch for #3716
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / class_faiHook.inc
index 3fdd7070f291a1832b6c2627df639c7921ea5fcd..281b3d6becb09cefa6f5e8447730756398bfd883 100644 (file)
@@ -43,15 +43,9 @@ class faiHook extends plugin
      */
     if($dn != "new"){
       $this->dn =$dn;
-   
-      /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
-       */
-      $res = FAI::get_all_objects_for_given_base($this->dn,"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))");
-      foreach($res as $obj){
-
-        /* Skip not relevant objects */
-        if(!preg_match("/".preg_quote($this->dn, '/')."$/i",$obj['dn'])) continue;
 
+      $res = FAI::get_leaf_objects($this->dn, $this->cn, $this->subClass, get_ou('faiHookRDN'));
+      foreach($res as $obj){
         $objects = array();
         $objects['status']      = "FreshLoaded";
         $objects['dn']          = $obj['dn'];