summaryrefslogtreecommitdiff
path: root/program/steps/settings/folders.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-01-29 14:55:12 +0000
committerthomascube <thomas@roundcube.net>2011-01-29 14:55:12 +0000
commit98cb0f179206843ceaa87df6bfb3d1da045ed8ad (patch)
treeade6196094997c24b48e8a432383bd2da9f6bc5c /program/steps/settings/folders.inc
parenta32679e69f7d6c265f85015677743272740dcc8e (diff)
Apply bug fixes and localization updated from trunk for release 0.5.1
Diffstat (limited to 'program/steps/settings/folders.inc')
-rw-r--r--program/steps/settings/folders.inc17
1 files changed, 14 insertions, 3 deletions
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index 7ae4fb35d..3494ba99a 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -42,8 +42,16 @@ if ($RCMAIL->action == 'subscribe')
}
}
- if ($result)
+ if ($result) {
+ // Handle subscription of protected folder (#1487656)
+ if ($CONFIG['protect_default_folders'] == true
+ && in_array($mbox, $CONFIG['default_imap_folders'])
+ ) {
+ $OUTPUT->command('disable_subscription', $mbox);
+ }
+
$OUTPUT->show_message('foldersubscribed', 'confirmation');
+ }
else
rcmail_display_server_error('errorsaving');
}
@@ -294,13 +302,16 @@ function rcube_subscription_form($attrib)
$noselect = in_array('\\Noselect', $opts);
}
+ $disabled = (($protected && $subscribed) || $noselect);
+
$table->add_row(array('id' => 'rcmrow'.$idx, 'class' => join(' ', $classes)));
$table->add('name', $display_folder);
$table->add('subscribed', $checkbox_subscribe->show(($subscribed ? $folder_utf8 : ''),
- array('value' => $folder_utf8, 'disabled' => ($protected || $noselect) ? 'disabled' : '')));
+ array('value' => $folder_utf8, 'disabled' => $disabled ? 'disabled' : '')));
- $a_js_folders['rcmrow'.$idx] = array($folder_utf8, Q($display_folder), $protected || $folder['virtual']);
+ $a_js_folders['rcmrow'.$idx] = array($folder_utf8,
+ Q($display_folder), $protected || $folder['virtual']);
}
$RCMAIL->plugins->exec_hook('folders_list', array('table' => $table));