From: hickert Date: Wed, 10 May 2006 09:23:36 +0000 (+0000) Subject: Added "gosaAdministrativeUnitTag" fix for partition tables X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=87d9d99a2cef53752f86bbd24a665fb2137b4a4f;p=gosa.git Added "gosaAdministrativeUnitTag" fix for partition tables git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3265 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc index 50a9bb1cd..336d93180 100644 --- a/plugins/admin/fai/class_faiPartitionTable.inc +++ b/plugins/admin/fai/class_faiPartitionTable.inc @@ -344,8 +344,7 @@ class faiPartitionTable extends plugin */ $ldap->cd($this->dn); $this->cleanup(); -$ldap->modify ($this->attrs); - + $ldap->modify ($this->attrs); show_ldap_error($ldap->get_error()); } @@ -374,11 +373,18 @@ $ldap->modify ($this->attrs); $disk_attrs['objectClass'] = array("top","FAIclass","FAIpartitionDisk"); if($disk['status']=="new"){ - $ldap->cat($disk_dn); + $ldap->cat($disk_dn,array("objectClass")); if($ldap->count()){ $disk['status']="edited"; } } + + /* Fix problem with missing objectClass "gosaAdministrativeUnitTag" for disks */ + $ldap->cat($disk_dn,array("objectClass")); + $attrs = $ldap->fetch(); + if(isset($attrs['objectClass']) && in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass'])){ + $disk_attrs['objectClass'][] = "gosaAdministrativeUnitTag"; + } if($disk['status'] == "delete"){ $ldap->cd($disk_dn); @@ -390,7 +396,6 @@ $ldap->modify ($this->attrs); $ldap->cd($disk_dn); $this->cleanup(); $ldap->modify ($disk_attrs); - }elseif($disk['status']== "new"){ if(empty($disk_attrs['description'])){ unset($disk_attrs['description']); @@ -428,7 +433,7 @@ $ldap->modify ($this->attrs); unset($partition_attrs['old_cn']); if($partition['status']=="new"){ - $ldap->cat($partition_dn); + $ldap->cat($partition_dn,array("objectClass")); if($ldap->count()){ $partition['status']="edited"; } @@ -438,6 +443,13 @@ $ldap->modify ($this->attrs); $partition_attrs['FAImountPoint']="swap"; } + /* Fix problem with missing objectClass "gosaAdministrativeUnitTag" for partitions */ + $ldap->cat($partition_dn,array("objectClass")); + $attrs = $ldap->fetch(); + if(isset($attrs['objectClass']) && in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass'])){ + $partition_attrs['objectClass'][] = "gosaAdministrativeUnitTag"; + } + if(($partition['status'] == "delete")&&($disk['status']!="new")){ $ldap->cd($partition_dn); $ldap->rmdir_recursive($partition_dn); diff --git a/plugins/admin/fai/class_faiProfile.inc b/plugins/admin/fai/class_faiProfile.inc index a3976d254..489b8bb26 100644 --- a/plugins/admin/fai/class_faiProfile.inc +++ b/plugins/admin/fai/class_faiProfile.inc @@ -412,13 +412,12 @@ class faiProfile extends plugin $this->attrs['FAIclass']=trim($this->FAIclass); - $ldap->cat($this->dn); + $ldap->cat($this->dn,array("objectClass")); if($ldap->count()!=0){ /* Write FAIscript to ldap*/ $ldap->cd($this->dn); $this->cleanup(); -$ldap->modify ($this->attrs); - + $ldap->modify ($this->attrs); }else{ /* Write FAIscript to ldap*/ $ldap->cd($this->config->current['BASE']);