summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-10-02 17:48:29 +0000
committeralecpl <alec@alec.pl>2008-10-02 17:48:29 +0000
commit52851464e0267795ffd688e3c769d9161011dba8 (patch)
treef8ce401c798f45e462d3cb49a6bdb7cf3eb99271 /program
parent2c832e451988be00e07c8ba1cc4ff8b5389feced (diff)
- Fix race conditions when changing mailbox (set some env variables only when needed - no action or action==list)
Diffstat (limited to 'program')
-rw-r--r--program/steps/mail/func.inc31
1 files changed, 16 insertions, 15 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index b6de0b83b..f2c4ea419 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -53,25 +53,26 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search
$OUTPUT->set_env('search_text', $_SESSION['last_text_search']);
}
+// set main env variables, labels and page title
+if (empty($RCMAIL->action) || $RCMAIL->action == 'list')
+ {
+ // set current mailbox in client environment
+ $OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name());
+ $OUTPUT->set_env('quota', $IMAP->get_capability('quota'));
+ $OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter());
-// set current mailbox in client environment
-$OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name());
-$OUTPUT->set_env('quota', $IMAP->get_capability('quota'));
-$OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter());
-
-if ($CONFIG['trash_mbox'])
- $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
-if ($CONFIG['drafts_mbox'])
- $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);
-if ($CONFIG['junk_mbox'])
- $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']);
+ if ($CONFIG['trash_mbox'])
+ $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
+ if ($CONFIG['drafts_mbox'])
+ $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);
+ if ($CONFIG['junk_mbox'])
+ $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']);
-if (!$OUTPUT->ajax_call)
- rcube_add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage');
+ if (!$OUTPUT->ajax_call)
+ rcube_add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage');
-// set page title
-if (empty($RCMAIL->action) || $RCMAIL->action == 'list')
$OUTPUT->set_pagetitle(rcmail_localize_foldername($IMAP->get_mailbox_name()));
+ }
/**