From 9899abc36caf00ed2a054b309607aa868e314e07 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 28 Jun 2012 10:43:50 +0200 Subject: 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). Conflicts: program/include/rcube_imap.php Conflicts: plugins/acl/acl.php plugins/acl/package.xml program/include/rcube_imap.php --- plugins/acl/acl.php | 13 +++++---- plugins/acl/package.xml | 63 ++++++++++++++++++++++++++++++++++++++++++ program/include/rcube_imap.php | 11 +++++++- 3 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 plugins/acl/package.xml diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index b2e5b8d47..cb47e661b 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -129,8 +129,10 @@ class acl extends rcube_plugin */ function folder_form($args) { - // Edited folder name (empty in create-folder mode) $mbox_imap = $args['options']['name']; + $myrights = $args['options']['rights']; + + // Edited folder name (empty in create-folder mode) if (!strlen($mbox_imap)) { return $args; } @@ -140,18 +142,17 @@ class acl extends rcube_plugin return $args; } */ - // Namespace root - if ($args['options']['is_root']) { - return $args; - } - // Get MYRIGHTS +<<<<<<< HEAD if (!($myrights = $args['options']['rights'])) { return $args; } // Do nothing if no ACL support if (!$this->rc->imap->get_capability('ACL')) { +======= + if (empty($myrights)) { +>>>>>>> e4c9942... Fix handling of MYRIGHTS on private namespace roots - fixes issue where return $args; } diff --git a/plugins/acl/package.xml b/plugins/acl/package.xml new file mode 100644 index 000000000..5f8638474 --- /dev/null +++ b/plugins/acl/package.xml @@ -0,0 +1,63 @@ + + + acl + pear.roundcube.net + Folders Access Control Lists + IMAP Folders Access Control Lists Management (RFC4314, RFC2086). + + Aleksander Machniak + alec + alec@alec.pl + yes + + 2012-06-28 + + 0.9 + 0.7 + + + stable + stable + + GNU GPLv2 + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5.2.1 + + + 1.7.0 + + + + + diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index ed84845c4..f06a8ee70 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -3653,7 +3653,7 @@ class rcube_imap $options['rights'] = $acl && !$options['is_root'] ? (array)$this->my_rights($mailbox) : array(); $options['special'] = in_array($mailbox, $this->default_folders); - // Set 'noselect' and 'norename' flags + // Set 'noselect' flag if (is_array($options['attributes'])) { foreach ($options['attributes'] as $attrib) { $attrib = strtolower($attrib); @@ -3666,6 +3666,15 @@ class rcube_imap $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($mailbox); + } + } + + // Set 'norename' flag if (!empty($options['rights'])) { $options['norename'] = !in_array('x', $options['rights']) && !in_array('d', $options['rights']); -- cgit v1.2.3