From ce5341b8e19836fc9ebcae4d73f675fdf50c6f52 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 May 2006 09:07:41 +0000 Subject: [PATCH] Fixes "gosaAdministrativeUnitTag" problem for Templates / Variables git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3263 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiTemplate.inc | 17 ++++++++++++++--- plugins/admin/fai/class_faiVariable.inc | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index 9ba26c649..a8be5fe48 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -308,7 +308,7 @@ class faiTemplate 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); @@ -363,9 +363,20 @@ class faiTemplate 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"; + } + } + + /* 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"; + } } } diff --git a/plugins/admin/fai/class_faiVariable.inc b/plugins/admin/fai/class_faiVariable.inc index 4a901123e..e49419096 100644 --- a/plugins/admin/fai/class_faiVariable.inc +++ b/plugins/admin/fai/class_faiVariable.inc @@ -277,7 +277,7 @@ class faiVariable 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); @@ -333,9 +333,20 @@ $ldap->modify ($this->attrs); $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"; + } + } + + /* 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"; + } } } -- 2.30.2