summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/group_ldap.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/group_ldap.php')
-rw-r--r--apps/user_ldap/group_ldap.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php
index 92e3b53d249..e5948459dd0 100644
--- a/apps/user_ldap/group_ldap.php
+++ b/apps/user_ldap/group_ldap.php
@@ -29,6 +29,7 @@ class OC_GROUP_LDAP extends OC_Group_Backend {
public function __construct() {
$this->ldapGroupFilter = OC_Appconfig::getValue('user_ldap', 'ldap_group_filter', '(objectClass=posixGroup)');
$this->ldapGroupDisplayName = OC_Appconfig::getValue('user_ldap', 'ldap_group_display_name', 'cn');
+ $this->ldapGroupMemberAttr = OC_Appconfig::getValue('user_ldap', 'ldap_group_member_attr', 'memberUid');
}
/**
@@ -83,7 +84,7 @@ class OC_GROUP_LDAP extends OC_Group_Backend {
$this->ldapGroupDisplayName.'='.$gid
));
- return $this->retrieveList($filter, OC_LDAP::conf('ldapUserDisplayName'));
+ return $this->retrieveList($filter, $this->ldapGroupMemberAttr);
}
/**
@@ -102,6 +103,15 @@ class OC_GROUP_LDAP extends OC_Group_Backend {
}
}
+ /**
+ * check if a group exists
+ * @param string $gid
+ * @return bool
+ */
+ public function groupExists($gid){
+ return in_array($gid, $this->getGroups());
+ }
+
private function retrieveList($filter, $attr) {
$list = OC_LDAP::search($filter, $attr);