From b48007194671de331c3757d1ade210a4af0f8c59 Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@owncloud.com>
Date: Sun, 15 Apr 2012 13:56:14 +0200
Subject: [PATCH] group LDAP: implemented getUserGroups()

---
 apps/user_ldap/group_ldap.php | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php
index 4702d69dab..92bc59c0de 100644
--- a/apps/user_ldap/group_ldap.php
+++ b/apps/user_ldap/group_ldap.php
@@ -65,6 +65,17 @@ class OC_GROUP_LDAP extends OC_Group_Backend {
 	 * if the user exists at all.
 	 */
 	public function getUserGroups($uid) {
+		$filter = OC_LDAP::combineFilterWithAnd(array(
+			$this->ldapGroupFilter,
+			LDAP_GROUP_MEMBER_ASSOC_ATTR.'='.$uid
+		));
+		$groups = OC_LDAP::search($filter, $this->ldapGroupDisplayName);
+
+		if(is_array($groups)) {
+			return $groups;
+		}
+
+		//error cause actually, maybe throw an exception in future.
 		return array();
 	}
 
-- 
GitLab