summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-06-28 10:43:50 +0200
committerAleksander Machniak <alec@alec.pl>2012-06-28 10:43:50 +0200
commitb866a27364a66c436156732553b1fa638e046b8b (patch)
treee25c15085bd33100d4545307579f68cb5dd2b5f7 /program/include/rcube_imap.php
parenta60d139d873b77852658ddac04279b6f1e5570ce (diff)
Fix handling of MYRIGHTS on private namespace roots - fixes issue where
in ACL plugin it wasn't possible to share INBOX folder (when it was a namespace prefix).
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r--program/include/rcube_imap.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 57b85c34e..94200b7da 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -3229,8 +3229,9 @@ class rcube_imap extends rcube_storage
$cache_key = 'mailboxes.folder-info.' . $folder;
$cached = $this->get_cache($cache_key);
- if (is_array($cached))
+ if (is_array($cached)) {
return $cached;
+ }
$acl = $this->get_capability('ACL');
$namespace = $this->get_namespace();
@@ -3267,10 +3268,9 @@ class rcube_imap extends rcube_storage
$options['name'] = $folder;
$options['attributes'] = $this->folder_attributes($folder, true);
$options['namespace'] = $this->folder_namespace($folder);
- $options['rights'] = $acl && !$options['is_root'] ? (array)$this->my_rights($folder) : array();
$options['special'] = in_array($folder, $this->default_folders);
- // Set 'noselect' and 'norename' flags
+ // Set 'noselect' flag
if (is_array($options['attributes'])) {
foreach ($options['attributes'] as $attrib) {
$attrib = strtolower($attrib);
@@ -3283,6 +3283,15 @@ class rcube_imap extends rcube_storage
$options['noselect'] = true;
}
+ // Get folder rights (MYRIGHTS)
+ if ($acl && !$options['noselect']) {
+ // skip shared roots
+ if (!$options['is_root'] || $options['namespace'] == 'personal') {
+ $options['rights'] = (array)$this->my_rights($folder);
+ }
+ }
+
+ // Set 'norename' flag
if (!empty($options['rights'])) {
$options['norename'] = !in_array('x', $options['rights']) && !in_array('d', $options['rights']);