From: cajus Date: Mon, 26 Jun 2006 09:13:39 +0000 (+0000) Subject: Fixed saving of departments X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5b8bb8a4a1de82c23f402770db413493a3a6f9e1;p=gosa.git Fixed saving of departments git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@3896 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index ee0e39fec..4369bb7bc 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -263,7 +263,9 @@ class department extends plugin if ($this->is_administrational_unit){ if(!in_array_ics("gosaAdministrativeUnit",$this->objectclasses)){ $this->objectclasses[]= "gosaAdministrativeUnit"; + $this->gosaUnitTag= ""; } + if ($this->gosaUnitTag == ""){ /* It's unlikely, but check if already used... */ @@ -297,13 +299,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(); } }