From a02d486cc8988ad367cd635f4929ce707ec6f542 Mon Sep 17 00:00:00 2001 From: thomascube Date: Tue, 5 Feb 2008 22:56:29 +0000 Subject: Applied patch to prevent from purging inbox (#1484449) + CSS hack for Safari --- program/steps/mail/folders.inc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'program/steps/mail/folders.inc') diff --git a/program/steps/mail/folders.inc b/program/steps/mail/folders.inc index c7c39fbea..b84398f26 100644 --- a/program/steps/mail/folders.inc +++ b/program/steps/mail/folders.inc @@ -39,18 +39,22 @@ if ($_action=='expunge' && ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))) // clear mailbox else if ($_action=='purge' && ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))) { - $success = $IMAP->clear_mailbox($mbox); - - if ($success && !empty($_REQUEST['_reload'])) + // we should only be purging trash and junk + if($mbox == $CONFIG['trash_mbox'] || $mbox == $CONFIG['junk_mbox']) { - $OUTPUT->set_env('messagecount', 0); - $OUTPUT->set_env('pagecount', 0); - $OUTPUT->command('message_list.clear'); - $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text()); - $OUTPUT->command('set_unread_count', $mbox_name, 0); + $success = $IMAP->clear_mailbox($mbox); + + if ($success && !empty($_REQUEST['_reload'])) + { + $OUTPUT->set_env('messagecount', 0); + $OUTPUT->set_env('pagecount', 0); + $OUTPUT->command('message_list.clear'); + $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text()); + $OUTPUT->command('set_unread_count', $mbox_name, 0); + } + else + $commands = "// purged: $success"; } - else - $commands = "// purged: $success"; } $OUTPUT->send($commands); -- cgit v1.2.3