From a77f7c585f69dce67f18c632fa988fe8b96883c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.bernigaud@opensides.be>
Date: Wed, 27 Apr 2016 07:51:11 +0200
Subject: [PATCH] Fixes #4746 The is_this_account user method is now more
 permissive (only inetOrgPerson is needed)

---
 plugins/personal/generic/class_user.inc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc
index 068c1d325..314ad7928 100644
--- a/plugins/personal/generic/class_user.inc
+++ b/plugins/personal/generic/class_user.inc
@@ -454,6 +454,12 @@ class user extends simplePlugin
     $this->was_locked = $this->attributesAccess['userPassword']->isLocked();
   }
 
+  function is_this_account($attrs)
+  {
+    /* Only inetOrgPerson is needed, it has the two others as SUP classes */
+    return (isset($attrs['objectClass']) && in_array_ics('inetOrgPerson', $attrs['objectClass']));
+  }
+
   function postCopyHook()
   {
     $this->attributesAccess['uid']->setDisabled($this->initially_was_account && !$this->is_template);
-- 
GitLab