summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-08-18 18:34:56 +0000
committerthomascube <thomas@roundcube.net>2011-08-18 18:34:56 +0000
commitb6cd452bd31bfd4b6b94b23fe54b424fdf901e61 (patch)
tree7b8640c4f06ef5a564a0a25c9f6d7d58d9d9abbc /program/steps
parentb1cde954d15abedbb2874f592c59155e049244ef (diff)
Backport changes from r5084 to r5090 to release branch
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/settings/folders.inc18
1 files changed, 10 insertions, 8 deletions
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index eea58062b..1d5df46e9 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -278,9 +278,6 @@ function rcube_subscription_form($attrib)
$display_folder = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $folder['level'])
. Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']);
- if ($sub_key !== false)
- unset($a_subscribed[$sub_key]);
-
if ($folder['virtual']) {
$classes[] = 'virtual';
}
@@ -317,6 +314,16 @@ function rcube_subscription_form($attrib)
}
}
}
+ // check if the folder is shared, then disable subscription option on it
+ if (!$disabled && $folder['virtual'] && !empty($namespace)) {
+ $tmp_ns = array_merge((array)$namespace['other'], (array)$namespace['shared']);
+ foreach ($tmp_ns as $item) {
+ if (strpos($folder['id'], $item[0]) === 0) {
+ $disabled = true;
+ break;
+ }
+ }
+ }
$table->add_row(array('id' => 'rcmrow'.$idx, 'class' => join(' ', $classes),
'foldername' => $folder['id']));
@@ -329,11 +336,6 @@ function rcube_subscription_form($attrib)
Q($display_folder), $protected || $folder['virtual']);
}
- // Unsubscribe from non-existing folders
- foreach ($a_subscribed as $folder) {
- $IMAP->unsubscribe($folder);
- }
-
$RCMAIL->plugins->exec_hook('folders_list', array('table' => $table));
$OUTPUT->add_gui_object('subscriptionlist', $attrib['id']);