From: hickert Date: Thu, 13 Mar 2008 08:57:00 +0000 (+0000) Subject: Fixed department creation X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0c65246cb57fa4a642ac522fe5876b5f13fcd84d;p=gosa.git Fixed department creation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9726 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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);