From dbc63628ac5bf6305f74cac78df34c238bcc7c06 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 10 Jun 2016 05:14:46 -0400 Subject: [PATCH] [#5436] Fix so 's' right is not removed from groupware folders --- plugins/kolab_folders/kolab_folders.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/kolab_folders/kolab_folders.php b/plugins/kolab_folders/kolab_folders.php index 242ef08b..ddab6663 100644 --- a/plugins/kolab_folders/kolab_folders.php +++ b/plugins/kolab_folders/kolab_folders.php @@ -464,13 +464,11 @@ class kolab_folders extends rcube_plugin // we're dealing with a groupware folder here... if ($type && $type !== 'mail') { if ($args['rights']['write'] && $args['rights']['delete']) { - $writeperms = $args['rights']['write'] . $args['rights']['delete']; - $items = array( - 'read' => 'lr', - 'write' => $writeperms, - 'other' => preg_replace('/[lr'.$writeperms.']/', '', $args['rights']['other']), - ); - $args['rights'] = $items; + $write_perms = $args['rights']['write'] . $args['rights']['delete']; + $rw_perms = $write_perms . $args['rights']['read']; + + $args['rights']['write'] = $write_perms; + $args['rights']['other'] = preg_replace("/[$rw_perms]/", '', $args['rights']['other']); // add localized labels and titles for the altered items $args['labels'] = array( @@ -501,7 +499,7 @@ class kolab_folders extends rcube_plugin // we're dealing with a groupware folder here... if ($type && $type !== 'mail') { // remove some irrelevant (for groupware objects) rights - $args['rights'] = str_split(preg_replace('/[sp]/', '', join('', $args['rights']))); + $args['rights'] = str_split(preg_replace('/[p]/', '', join('', $args['rights']))); } }