group LDAP: implemented getUserGroups()

This commit is contained in:
Arthur Schiwon 2012-04-15 13:56:14 +02:00
parent 0912f40ebe
commit b480071946
1 changed files with 11 additions and 0 deletions

View File

@ -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();
}