summaryrefslogtreecommitdiff
path: root/program/steps/settings/save_prefs.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/settings/save_prefs.inc')
-rw-r--r--program/steps/settings/save_prefs.inc28
1 files changed, 11 insertions, 17 deletions
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index f71eee39a..7a17f21f4 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -121,12 +121,12 @@ case 'server':
case 'folders':
$a_user_prefs = array(
'show_real_foldernames' => isset($_POST['_show_real_foldernames']) ? true : false,
- 'drafts_mbox' => rcube_utils::get_input_value('_drafts_mbox', rcube_utils::INPUT_POST, true),
- 'sent_mbox' => rcube_utils::get_input_value('_sent_mbox', rcube_utils::INPUT_POST, true),
- 'junk_mbox' => rcube_utils::get_input_value('_junk_mbox', rcube_utils::INPUT_POST, true),
- 'trash_mbox' => rcube_utils::get_input_value('_trash_mbox', rcube_utils::INPUT_POST, true),
);
+ foreach (rcube_storage::$folder_types as $type) {
+ $a_user_prefs[$type . '_mbox'] = rcube_utils::get_input_value('_' . $type . '_mbox', rcube_utils::INPUT_POST, true);
+ };
+
break;
}
@@ -191,21 +191,15 @@ case 'addressbook':
break;
case 'folders':
- // special handling for 'default_folders'
- if (in_array('default_folders', (array)$CONFIG['dont_override'])) {
- foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) {
- $a_user_prefs[$p] = $CONFIG[$p];
- }
- }
- else {
- $a_user_prefs['default_folders'] = array('INBOX');
- foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) {
- if ($a_user_prefs[$p]) {
- $a_user_prefs['default_folders'][] = $a_user_prefs[$p];
- }
- }
+ $storage = $RCMAIL->get_storage();
+ $specials = array();
+
+ foreach (rcube_storage::$folder_types as $type) {
+ $specials[$type] = $a_user_prefs[$type . '_mbox'];
}
+ $storage->set_special_folders($specials);
+
break;
}