diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-10-26 11:34:27 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-10-26 11:34:27 +0100 |
commit | 0f711e7bd744053d89997d0c8c16938c8d1b9170 (patch) | |
tree | af6dea62ac7630d3b78ec9712303208674501258 /plugins | |
parent | aca8bd2bd602769ce54daa1211dabec92870da92 (diff) | |
parent | c1e2ce76c731fea1b21142110bcacd5986d83dc8 (diff) |
Merge pull request #234 from bnogas/master-p3
Add config option 'acl_group_field' to use as ACL group identifier
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/acl/acl.php | 10 | ||||
-rw-r--r-- | plugins/acl/config.inc.php.dist | 3 |
2 files changed, 9 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; } } diff --git a/plugins/acl/config.inc.php.dist b/plugins/acl/config.inc.php.dist index de1f8b5d2..d8ef8792c 100644 --- a/plugins/acl/config.inc.php.dist +++ b/plugins/acl/config.inc.php.dist @@ -23,6 +23,9 @@ $config['acl_groups'] = false; // Prefix added to the group name to build IMAP ACL identifier $config['acl_group_prefix'] = 'group:'; +// The LDAP attribute which will be used as ACL group identifier +$config['acl_group_field'] = 'name'; + // Include the following 'special' access control subjects in the ACL dialog; // Defaults to array('anyone', 'anonymous') (not when set to an empty array) // Example: array('anyone') to exclude 'anonymous'. |