diff options
author | Bartlomiej Nogas <bart.nogas@gmail.com> | 2014-10-20 17:01:45 +0200 |
---|---|---|
committer | Bartlomiej Nogas <bart.nogas@gmail.com> | 2014-10-21 12:05:35 +0200 |
commit | c1e2ce76c731fea1b21142110bcacd5986d83dc8 (patch) | |
tree | de16fd2ea8eabaa45ccf423b0ac640c30f3676f0 /plugins/acl/acl.php | |
parent | e2251db1d5b536f61fe7db57b96a9601465bd139 (diff) |
Add configuration option 'acl_group_field' to use as ACL group identifier
Diffstat (limited to 'plugins/acl/acl.php')
-rw-r--r-- | plugins/acl/acl.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index 33bd91e22..cc4d99661 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -114,14 +114,16 @@ class acl extends rcube_plugin } if ($this->rc->config->get('acl_groups')) { - $prefix = $this->rc->config->get('acl_group_prefix'); - $result = $this->ldap->list_groups($search, $mode); + $prefix = $this->rc->config->get('acl_group_prefix'); + $group_field = $this->rc->config->get('acl_group_field') ? $this->rc->config->get('acl_group_field') : 'name'; + $result = $this->ldap->list_groups($search, $mode); foreach ($result as $record) { - $group = $record['name']; + $group = $record['name']; + $group_id = is_array($record[$group_field]) ? $record[$group_field][0] : $record[$group_field]; if ($group) { - $users[] = array('name' => ($prefix ? $prefix : '') . $group, 'display' => $group); + $users[] = array('name' => ($prefix ? $prefix : '') . $group_id, 'display' => $group); $keys[] = $group; } } |