From 75ad5ddcb673e0d3d0103bd262e4abb674d62c04 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 18 Jul 2008 10:35:00 +0000 Subject: [PATCH] Fixed FAI problem with copy on write. - Only works for scripts, yet. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11710 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/fai/admin/fai/class_FAI.inc | 2 +- .../fai/admin/fai/class_faiScript.inc | 34 +++---------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_FAI.inc b/gosa-plugins/fai/admin/fai/class_FAI.inc index e2421b443..75a7b1f68 100644 --- a/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -21,7 +21,7 @@ class FAI $tmp = array(); if(!FAI::is_release_department($Current_DN)) { - return($res); +# return($res); } /* Collect some basic informations and initialize some variables */ diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index dec9e21e7..4f471c07a 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -47,44 +47,18 @@ class faiScript extends plugin * First read SubObjects from ldap ... and then the partition definitions for the SubObjects. */ if($dn != "new"){ - $this->dn =$dn; - /* Get FAIstate - */ - if(isset($this->attrs['FAIstate'][0])){ - $this->FAIstate = $this->attrs['FAIstate'][0]; - } - /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry) */ - $ldap = $this->config->get_ldap_link(); - $ldap->cd ($this->dn); - - $attrs_to_search = $this->subAttributes; - $attrs_to_search[] = "FAIstate"; - $ldap->search("(&(objectClass=FAIclass)(objectClass=".$this->subClass."))",$attrs_to_search); - $data = array(); - while($object = $ldap->fetch()){ - $data[] = $object; - } - foreach($data as $object){ - - /* Skip objects, that are tagged as removed */ - if(isset($object['FAIstate'][0])){ - if(preg_match("/removed$/",$object['FAIstate'][0])){ - continue; - } - } - - /* Set status for save management */ + $res = FAI::get_all_objects_for_given_base($this->dn,"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))"); + foreach($res as $obj){ $objects = array(); $objects['status'] = "FreshLoaded"; - $objects['dn'] = $object['dn']; + $objects['dn'] = $obj['dn']; $objects = $this->get_object_attributes($objects,$this->subAttributes); $this->SubObjects[$objects['cn']] = $objects; } - } $this->is_new = FALSE; @@ -191,7 +165,7 @@ class faiScript extends plugin } /* Delete script requested */ - if(preg_match("/^deletescript_/",$name) && preg_match("/freeze/i",$this->FAIstate)){ + if(preg_match("/^deletescript_/",$name) && !preg_match("/freeze/i",$this->FAIstate)){ $s_action = "remove"; $s_entry = preg_replace("/^deletescript_/","",$name); $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry)); -- 2.30.2