From 0c65246cb57fa4a642ac522fe5876b5f13fcd84d Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 13 Mar 2008 08:57:00 +0000 Subject: [PATCH] Fixed department creation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9726 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../departments/class_departmentGeneric.inc | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc index e76d4e386..beda40082 100644 --- a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc +++ b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc @@ -312,33 +312,27 @@ class department extends plugin $this->skipTagging = TRUE; plugin::save(); + /* Remove tag information if needed */ - if (!$this->is_administrational_unit){ + if (!$this->is_administrational_unit && $this->initially_was_tagged){ $tmp= array(); /* Remove gosaAdministrativeUnit from this plugin */ + $has_unit_tag= false; foreach($this->attrs['objectClass'] as $oc){ if (!preg_match("/^gosaAdministrativeUnit$/i", $oc)){ $tmp[]= $oc; } + if (preg_match("/^gosaAdministrativeUnitTag$/i", $oc)){ + $has_unit_tag= true; + } } $this->attrs['objectClass']= $tmp; - } - - /* Do we need to remove the tag itself? */ - $has_unit_tag= false; - foreach($this->attrs['objectClass'] as $oc){ - if (preg_match("/^gosaAdministrativeUnitTag$/i", $oc)){ - $has_unit_tag= true; - } - } - if ($has_unit_tag == false && $this->is_administrational_unit == false){ $this->attrs['gosaUnitTag']= array(); $this->gosaUnitTag = ""; - } else { - $this->attrs['gosaUnitTag']= $this->gosaUnitTag; } + /* Write back to ldap */ $ldap->cat($this->dn, array('dn')); $ldap->cd($this->dn); -- 2.30.2