diff options
Diffstat (limited to 'program/steps/settings/func.inc')
-rw-r--r-- | program/steps/settings/func.inc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index de9da282f..72e278364 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -790,14 +790,29 @@ function rcmail_folder_options($mailbox) $acl = $RCMAIL->imap->get_capability('ACL'); $default_folders = (array) $RCMAIL->config->get('default_imap_folders'); + $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); + $namespace = $RCMAIL->imap->get_namespace(); $options = array(); + // check if the folder is a namespace prefix + if (!empty($namespace)) { + $mbox = $mailbox . $delimiter; + foreach ($namespace as $ns) { + foreach ($ns as $item) { + if ($item[0] === $mbox) { + $options['is_root'] = true; + break; + } + } + } + } + $options['name'] = $mailbox; $options['options'] = $RCMAIL->imap->mailbox_options($mailbox, true); $options['namespace'] = $RCMAIL->imap->mailbox_namespace($mailbox); - $options['rights'] = $acl ? (array)$RCMAIL->imap->my_rights($mailbox) : array(); + $options['rights'] = $acl && !$options['is_root'] ? (array)$RCMAIL->imap->my_rights($mailbox) : array(); $options['special'] = in_array($mailbox, $default_folders); - $options['protected'] = $options['special'] && $RCMAIL->config->get('protect_default_folders'); + $options['protected'] = $options['is_root'] || ($options['special'] && $RCMAIL->config->get('protect_default_folders')); if (is_array($options['options'])) { foreach ($options['options'] as $opt) { |