Code

Fixed department creation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 13 Mar 2008 08:57:00 +0000 (08:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 13 Mar 2008 08:57:00 +0000 (08:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9726 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/departments/class_departmentGeneric.inc

index e76d4e38645124a79c864fe6655d8272e212b151..beda40082a374b1db3b707d3209e355c466fdd80 100644 (file)
@@ -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);