From: cajus Date: Mon, 8 May 2006 10:38:15 +0000 (+0000) Subject: Fixed tagging for objects that are newley created or modified X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f40fd344605bcaa8c8ec355d1ea35c556accc766;p=gosa.git Fixed tagging for objects that are newley created or modified git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3218 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 5c1484d27..4e761fbaa 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -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 != ""){