From: hickert Date: Wed, 10 May 2006 09:04:03 +0000 (+0000) Subject: Added "gosaAdministrativeUnitTag" fix for Hooks / Scripts X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f3769f8215b3d536d4d725139498852388ae97fd;p=gosa.git Added "gosaAdministrativeUnitTag" fix for Hooks / Scripts git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3262 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index 4caa9d0e2..dcef17f8f 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -429,12 +429,12 @@ class faiHook extends plugin if($obj['status']=="new"){ $ldap->cat($sub_dn,array("objectClass")); if($ldap->count()){ - $obj['status']="modify"; + $obj['status']="edited"; } } /* Check if gosaAdministrativeUnitTag is required as object class */ - if($obj['status'] == "modify"){ + if($obj['status'] == "edited"){ $ldap->cat($sub_dn,array("objectClass")); $attrs = $ldap->fetch(); if(isset($attrs['objectClass'])){ diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index c614aa04c..798f63946 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -336,7 +336,7 @@ class faiScript 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); @@ -396,9 +396,9 @@ class faiScript 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"; + $obj['status']="edited"; } } @@ -406,6 +406,17 @@ class faiScript extends plugin $tmp['FAIpriority'] ="0"; } + /* Check if gosaAdministrativeUnitTag is required as object class */ + if($obj['status'] == "edited"){ + $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);