From eddb14dfe8b2a4b1d2044974d4f2c3dfbfdd46d2 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 May 2006 08:58:05 +0000 Subject: [PATCH] Fixed Hook "gosaAdministrativeUnitTag" problem git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3261 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiHook.inc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index 3fba9649c..4caa9d0e2 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -365,7 +365,7 @@ class faiHook extends plugin $ldap = $this->config->get_ldap_link(); - $ldap->cat($this->dn); + $ldap->cat($this->dn,array("objectClass")); if($ldap->count()!=0){ /* Write FAIscript to ldap*/ $ldap->cd($this->dn); @@ -427,12 +427,23 @@ class faiHook extends plugin $sub_dn = "cn=".$obj['cn'].",".$this->dn; if($obj['status']=="new"){ - $ldap->cat($sub_dn); + $ldap->cat($sub_dn,array("objectClass")); if($ldap->count()){ $obj['status']="modify"; } } + /* Check if gosaAdministrativeUnitTag is required as object class */ + if($obj['status'] == "modify"){ + $ldap->cat($sub_dn,array("objectClass")); + $attrs = $ldap->fetch(); + if(isset($attrs['objectClass'])){ + if(in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass'])){ + $tmp['objectClass'][] = "gosaAdministrativeUnitTag"; + } + } + } + if($obj['status'] == "delete"){ $ldap->cd($sub_dn); $ldap->rmdir_recursive($sub_dn); @@ -441,7 +452,6 @@ class faiHook extends plugin $ldap->cd($sub_dn); $this->cleanup(); $ldap->modify ($tmp); - $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ if($tmp['description']==array()){ -- 2.30.2