Bartlomiej Nogas
2014-10-20 c1e2ce76c731fea1b21142110bcacd5986d83dc8
Add configuration option 'acl_group_field' to use as ACL group identifier
2 files modified
13 ■■■■■ changed files
plugins/acl/acl.php 10 ●●●●● patch | view | raw | blame | history
plugins/acl/config.inc.php.dist 3 ●●●●● patch | view | raw | blame | history
plugins/acl/acl.php
@@ -114,14 +114,16 @@
            }
            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;
                    }
                }
plugins/acl/config.inc.php.dist
@@ -23,6 +23,9 @@
// 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'.