From 5cf4478fd5a0888f16ca871b5897d7004eb4e17a Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 26 Jun 2006 09:13:29 +0000 Subject: [PATCH] Fixed saving of departments git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3895 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/departments/class_departmentGeneric.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index 3df4f4a3e..feda1d7fd 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -270,6 +270,7 @@ class department extends plugin if ($this->is_administrational_unit){ if(!in_array_ics("gosaAdministrativeUnit",$this->objectclasses)){ $this->objectclasses[]= "gosaAdministrativeUnit"; + $this->gosaUnitTag= ""; } if ($this->gosaUnitTag == ""){ @@ -304,13 +305,18 @@ class department extends plugin $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; - if(isset($this->attrs['gosaUnitTag'])){ + + if(!$has_unit_tag && isset($this->attrs['gosaUnitTag'])){ $this->attrs['gosaUnitTag']= array(); } } -- 2.30.2