diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-05-11 19:21:02 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-05-11 19:21:13 +0200 |
commit | 3c2af95108ee87edfe96a5518e9f9cebfbdaa414 (patch) | |
tree | c9164e9ad7115f41b9488513479c456cb9ed13b0 /apps/user_ldap/group_ldap.php | |
parent | 8e5240d5790e5ab1a9a2f1991df118d14edd1e4e (diff) | |
download | nextcloud-server-3c2af95108ee87edfe96a5518e9f9cebfbdaa414.tar.gz nextcloud-server-3c2af95108ee87edfe96a5518e9f9cebfbdaa414.zip |
LDAP: offer only ownCloud-enabled users for sharing
Diffstat (limited to 'apps/user_ldap/group_ldap.php')
-rwxr-xr-x | apps/user_ldap/group_ldap.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 168476a78ec..01aa2220df5 100755 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -121,8 +121,9 @@ class OC_GROUP_LDAP extends OC_Group_Backend { } $result = array(); + $isMemberUid = (strtolower($this->ldapGroupMemberAssocAttr) == 'memberuid'); foreach($members as $member) { - if(strtolower($this->ldapGroupMemberAssocAttr) == 'memberuid') { + if($isMemberUid) { $filter = str_replace('%uid', $member, OC_LDAP::conf('ldapLoginFilter')); $ldap_users = OC_LDAP::fetchListOfUsers($filter, 'dn'); if(count($ldap_users) < 1) { @@ -130,9 +131,12 @@ class OC_GROUP_LDAP extends OC_Group_Backend { } $result[] = OC_LDAP::dn2username($ldap_users[0]); continue; + } else { + $result[] = OC_LDAP::dn2username($member); } - //de-facto else - $result[] = OC_LDAP::dn2username($member); + } + if(!$isMemberUid) { + $result = array_intersect($result, OCP\User::getUsers()); } return array_unique($result, SORT_LOCALE_STRING); } |