summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/manage_folders.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc
index 344e40422..4d5882f6e 100644
--- a/program/steps/settings/manage_folders.inc
+++ b/program/steps/settings/manage_folders.inc
@@ -97,12 +97,18 @@ else if ($_action=='rename-folder')
// delete an existing IMAP mailbox
else if ($_action=='delete-folder')
{
+ $a_mboxes = array_merge($IMAP->list_mailboxes(), $IMAP->list_unsubscribed());
+ $delimiter = $IMAP->get_hierarchy_delimiter();
+
if ($mboxes = get_input_value('_mboxes', RCUBE_INPUT_POST))
$deleted = $IMAP->delete_mailbox(array($mboxes));
if ($OUTPUT->ajax_call && $deleted)
{
$OUTPUT->command('remove_folder_row', get_input_value('_mboxes', RCUBE_INPUT_POST));
+ foreach ($a_mboxes as $mbox)
+ if (preg_match('/^'.preg_quote(get_input_value('_mboxes', RCUBE_INPUT_POST).$delimiter).'/', $mbox))
+ $OUTPUT->command('remove_folder_row', $mbox);
$OUTPUT->show_message('folderdeleted', 'confirmation');
$OUTPUT->send();
}