Code

Fixed tagging for objects that are newley created or modified
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 May 2006 10:38:15 +0000 (10:38 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 May 2006 10:38:15 +0000 (10:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3218 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_plugin.inc

index 5c1484d27ef49183c4559bb837628759bdd9c1f9..4e761fbaa65dd73dd4da311e2ac517351d73e74f 100644 (file)
@@ -862,7 +862,24 @@ class plugin
     }
     
     /* No tag? Find it yourself... */
-    #....
+    if ($tag == ""){
+      $len= strlen($this->dn);
+      $fix= true;
+      foreach ($this->config->adepartments as $key => $tag){
+        /* This one is shorter than our dn, its not relevant... */
+        if ($len >= strlen($key)){
+          continue;
+        }
+
+        /* This one matches with the latter part. Break and don't fix this entry */
+        if (preg_match('/(^|,)'.normalizePreg($key).'$/', $dn)){
+          $fix= false;
+          break;
+        }
+      }
+      $this->gosaUnitTag= $tag;
+    }
 
     /* Set tag? */
     if ($tag != ""){