From 7467061f7d9a6f1383598e86b9e7a4d52a7eda64 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 11 Aug 2008 08:48:05 +0000 Subject: [PATCH] Fixed FAI varible handling. Closes #522 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12187 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiVariable.inc | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc index bf49ff538..1ace86d1b 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariable.inc @@ -43,12 +43,8 @@ class faiVariable extends plugin /* 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."))"); + $res = FAI::get_all_objects_for_given_object($this->dn,"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))"); foreach($res as $obj){ - - /* Skip not relevant objects */ - if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue; - $objects = array(); $objects['description'] = ""; $objects['status'] = "FreshLoaded"; @@ -148,15 +144,16 @@ class faiVariable extends plugin }else{ $obj = $this->dialog->save(); if(isset($obj['remove'])){ - if($this->SubObjects[$obj['remove']['from']]['status']=="edited"){ + if($this->SubObjects[$obj['remove']['from']]['status'] != "new"){ $this->SubObjects[$obj['remove']['from']]['status'] = "delete"; - }elseif($this->SubObjects[$obj['remove']['from']]['status']=="new"){ + }else{ unset($this->SubObjects[$obj['remove']['from']]); } $obj['status'] = "new"; $this->SubObjects[$obj['remove']['to']] = $obj; unset($this->SubObjects[$obj['remove']['to']]['remove']); }else{ + $obj['status'] = "edited"; $this->SubObjects[$obj['cn']]=$obj; } $this->is_dialog=false; @@ -328,13 +325,7 @@ class faiVariable extends plugin * Because we must delete old entries first. * After deletion, we perform add and modify */ - $Objects = array(); - foreach($this->SubObjects as $name => $obj){ - if($obj['status'] == "delete"){ - $Objects[$name] = $obj; - } - } - + $Objects = $this->SubObjects; foreach($Objects as $name => $obj){ foreach($this->sub64coded as $codeIt){ @@ -384,12 +375,9 @@ class faiVariable extends plugin /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry) */ - $res = FAI::get_all_objects_for_given_base($source['dn'],"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))"); + $res = FAI::get_all_objects_for_given_object($source['dn'],"(&(objectClass=FAIclass)(objectClass=".$this->subClass."))"); foreach($res as $obj){ - /* Skip not relevant objects */ - if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue; - $objects = array(); $objects['status'] = "edited"; $objects['dn'] = $obj['dn']; -- 2.30.2