From 5435e813a82edf91edf180b4d54f4e04170a10e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be>
Date: Wed, 7 Jun 2017 11:35:36 +0200
Subject: [PATCH] Fixes #5545 When using uniqueFilter, ignore objectType base
 checking

---
 include/simpleplugin/class_Attribute.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/simpleplugin/class_Attribute.inc b/include/simpleplugin/class_Attribute.inc
index f37636b47..146a414b0 100644
--- a/include/simpleplugin/class_Attribute.inc
+++ b/include/simpleplugin/class_Attribute.inc
@@ -525,7 +525,7 @@ class Attribute
                 break;
               }
             }
-          } else { /* whole (or sub) */
+          } elseif ($this->uniqueFilter === NULL) { /* whole (or sub) */
             /* Check that this entry is in a concerned branch */
             foreach ($branches as $branch) {
               if (preg_match('/^'.preg_quote($branch, '/').'/', $dn_base)) {
@@ -537,6 +537,8 @@ class Attribute
             if (!in_array($dn_base, $config->departments)) {
               continue;
             }
+          } else {
+            $found = TRUE;
           }
           if (!$found) {
             continue;
-- 
GitLab