summaryrefslogtreecommitdiff
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 11:29:32 +0200
commit9899abc36caf00ed2a054b309607aa868e314e07 (patch)
tree05918d7918876dab96315d90dd48ff8b2b5932c5
parent77799d87ba05a8e96d604693dcfa003b5835fe2b (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). Conflicts: program/include/rcube_imap.php Conflicts: plugins/acl/acl.php plugins/acl/package.xml program/include/rcube_imap.php
-rw-r--r--plugins/acl/acl.php13
-rw-r--r--plugins/acl/package.xml63
-rw-r--r--program/include/rcube_imap.php11
3 files changed, 80 insertions, 7 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
+ http://pear.php.net/dtd/tasks-1.0.xsd
+ http://pear.php.net/dtd/package-2.0
+ http://pear.php.net/dtd/package-2.0.xsd">
+ <name>acl</name>
+ <channel>pear.roundcube.net</channel>
+ <summary>Folders Access Control Lists</summary>
+ <description>IMAP Folders Access Control Lists Management (RFC4314, RFC2086).</description>
+ <lead>
+ <name>Aleksander Machniak</name>
+ <user>alec</user>
+ <email>alec@alec.pl</email>
+ <active>yes</active>
+ </lead>
+ <date>2012-06-28</date>
+ <version>
+ <release>0.9</release>
+ <api>0.7</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license>
+ <notes>-</notes>
+ <contents>
+ <dir baseinstalldir="/" name="/">
+ <file name="acl.php" role="php">
+ <tasks:replace from="@name@" to="name" type="package-info"/>
+ <tasks:replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file name="acl.js" role="data">
+ <tasks:replace from="@name@" to="name" type="package-info"/>
+ <tasks:replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file name="config.inc.php.dist" role="data"></file>
+ <file name="localization/de_DE.inc" role="data"></file>
+ <file name="localization/en_US.inc" role="data"></file>
+ <file name="localization/pl_PL.inc" role="data"></file>
+ <file name="skins/default/acl.css" role="data"></file>
+ <file name="skins/default/images/enabled.png" role="data"></file>
+ <file name="skins/default/images/partial.png" role="data"></file>
+ <file name="skins/default/templates/table.html" role="data"></file>
+ <file name="skins/larry/acl.css" role="data"></file>
+ <file name="skins/larry/images/enabled.png" role="data"></file>
+ <file name="skins/larry/images/partial.png" role="data"></file>
+ <file name="skins/larry/templates/table.html" role="data"></file>
+ </dir>
+ <!-- / -->
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.2.1</min>
+ </php>
+ <pearinstaller>
+ <min>1.7.0</min>
+ </pearinstaller>
+ </required>
+ </dependencies>
+ <phprelease/>
+</package>
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']);