diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-08-11 03:35:07 -0400 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-08-11 03:35:07 -0400 |
commit | ec2733f6c35ca3d470172f9e35ae94399a78c2f4 (patch) | |
tree | 6a9846666dfb50589927cbe90c8bff2241b67cf0 /plugins/acl/acl.php | |
parent | f25c01464f25382fafc5aa1a65ff89129a98b222 (diff) |
Add support for groups
Diffstat (limited to 'plugins/acl/acl.php')
-rw-r--r-- | plugins/acl/acl.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index 5c4deb770..33bd91e22 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -112,6 +112,20 @@ class acl extends rcube_plugin $keys[] = $display ?: $user['name']; } } + + if ($this->rc->config->get('acl_groups')) { + $prefix = $this->rc->config->get('acl_group_prefix'); + $result = $this->ldap->list_groups($search, $mode); + + foreach ($result as $record) { + $group = $record['name']; + + if ($group) { + $users[] = array('name' => ($prefix ? $prefix : '') . $group, 'display' => $group); + $keys[] = $group; + } + } + } } if (count($users)) { @@ -448,9 +462,13 @@ class acl extends rcube_plugin $result = 0; foreach ($users as $user) { - $user = trim($user); + $user = trim($user); + $prefix = $this->rc->config->get('acl_groups') ? $this->rc->config->get('acl_group_prefix') : ''; - if (!empty($this->specials) && in_array($user, $this->specials)) { + if ($prefix && strpos($user, $prefix) === 0) { + $username = $user; + } + else if (!empty($this->specials) && in_array($user, $this->specials)) { $username = $this->gettext($user); } else if (!empty($user)) { |