diff options
-rw-r--r-- | config/main.inc.php.dist | 2 | ||||
-rw-r--r-- | program/lib/Roundcube/rcube_ldap.php | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist index 1812105c1..f24f51ff3 100644 --- a/config/main.inc.php.dist +++ b/config/main.inc.php.dist @@ -711,12 +711,14 @@ $rcmail_config['ldap_public']['Verisign'] = array( 'scope' => 'list', 'base_dn' => 'ou=Groups,dc=mydomain,dc=com', 'filter' => '(|(objectclass=groupofuniquenames)(objectclass=groupofurls))', + 'name_attr' => 'cn', ), 'customers' => array( 'name' => 'Customers', 'scope' => 'sub', 'base_dn' => 'ou=Customers,dc=mydomain,dc=com', 'filter' => '(objectClass=inetOrgPerson)', + 'name_attr' => 'sn', ), ), ); diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php index 54077c692..323dac3ce 100644 --- a/program/lib/Roundcube/rcube_ldap.php +++ b/program/lib/Roundcube/rcube_ldap.php @@ -88,7 +88,11 @@ class rcube_ldap extends rcube_addressbook if (is_array($p['group_filters']) && count($p['group_filters'])) { $this->groups = true; - foreach ($p['group_filters'] as $group_filter) { + foreach ($p['group_filters'] as $k => $group_filter) { + // set default name attribute to cn + if (empty($group_filter['name_attr']) && empty($this->prop['groups']['name_attr'])) + $this->prop['group_filters'][$k]['name_attr'] = $group_filter['name_attr'] = 'cn'; + if ($group_filter['name_attr']) $fetch_attributes[] = $group_filter['name_attr']; } |