From c5ac073c9f48ce33960f66f5cc925bb452ae18b2 Mon Sep 17 00:00:00 2001 From: svncommit Date: Thu, 18 May 2006 15:46:50 +0000 Subject: renamed $mbox so that it will stop interfering with the $_SESSION when register_globals is turned on --- program/steps/mail/check_recent.inc | 6 +++--- program/steps/mail/folders.inc | 4 ++-- program/steps/mail/func.inc | 23 +++++++++++++---------- program/steps/mail/getunread.inc | 4 ++-- program/steps/mail/list.inc | 10 +++++----- program/steps/mail/mark.inc | 5 ++--- program/steps/mail/sendmail.inc | 6 +++--- 7 files changed, 30 insertions(+), 28 deletions(-) (limited to 'program') diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc index 0bde47ed8..8a563c4c4 100644 --- a/program/steps/mail/check_recent.inc +++ b/program/steps/mail/check_recent.inc @@ -20,14 +20,14 @@ */ $REMOTE_REQUEST = TRUE; -$mbox = $IMAP->get_mailbox_name(); +$mbox_name = $IMAP->get_mailbox_name(); if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) { $count = $IMAP->messagecount(); $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE); - $commands = sprintf("this.set_unread_count('%s', %d, true);\n", addslashes($mbox), $unread_count); + $commands = sprintf("this.set_unread_count('%s', %d, true);\n", addslashes($mbox_name), $unread_count); $commands .= sprintf("this.set_env('messagecount', %d);\n", $count); $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); $commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota()); @@ -40,7 +40,7 @@ if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) $commands .= rcmail_js_message_list($a_headers, TRUE); } -if (strtoupper($mbox)!='INBOX' && $IMAP->messagecount('INBOX', 'RECENT')) +if (strtoupper($mbox_name)!='INBOX' && $IMAP->messagecount('INBOX', 'RECENT')) $commands = sprintf("this.set_unread_count('INBOX', %d);\n", $IMAP->messagecount('INBOX', 'UNSEEN')); diff --git a/program/steps/mail/folders.inc b/program/steps/mail/folders.inc index 5a22b7e72..d614ac841 100644 --- a/program/steps/mail/folders.inc +++ b/program/steps/mail/folders.inc @@ -19,7 +19,7 @@ */ $REMOTE_REQUEST = TRUE; -$mbox = $IMAP->get_mailbox_name(); +$mbox_name = $IMAP->get_mailbox_name(); // send EXPUNGE command @@ -49,7 +49,7 @@ else if ($_action=='purge') $commands .= "this.set_env('messagecount', 0);\n"; $commands .= "this.set_env('pagecount', 0);\n"; $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); - $commands .= sprintf("this.set_unread_count('%s', 0);\n", addslashes($mbox)); + $commands .= sprintf("this.set_unread_count('%s', 0);\n", addslashes($mbox_name)); } else $commands = "// purged: $success"; diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 83c8bd877..1be690a0b 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -25,6 +25,10 @@ require_once('lib/enriched.inc'); $EMAIL_ADDRESS_PATTERN = '/([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})/i'; +if (empty($_SESSION['mbox'])){ + $_SESSION['mbox'] = $IMAP->get_mailbox_name(); +} + // set imap properties and session vars if (strlen($_GET['_mbox'])) { @@ -57,7 +61,6 @@ if (strlen($_GET['_uid'])) // set current mailbox in client environment $OUTPUT->add_script(sprintf("%s.set_env('mailbox', '%s');", $JS_OBJECT_NAME, $IMAP->get_mailbox_name())); - if ($CONFIG['trash_mbox']) $OUTPUT->add_script(sprintf("%s.set_env('trash_mailbox', '%s');", $JS_OBJECT_NAME, $CONFIG['trash_mbox'])); @@ -93,7 +96,7 @@ function rcmail_mailbox_list($attrib) rcube_label($attrib['noselection'])); // get mailbox list - $mbox = $IMAP->get_mailbox_name(); + $mbox_name = $IMAP->get_mailbox_name(); // for these mailboxes we have localized labels $special_mailboxes = array('inbox', 'sent', 'drafts', 'trash', 'junk'); @@ -116,9 +119,9 @@ function rcmail_mailbox_list($attrib) // var_dump($a_mailboxes); if ($type=='select') - $out .= rcmail_render_folder_tree_select($a_mailboxes, $special_mailboxes, $mbox, $attrib['maxlength']); + $out .= rcmail_render_folder_tree_select($a_mailboxes, $special_mailboxes, $mbox_name, $attrib['maxlength']); else - $out .= rcmail_render_folder_tree_html($a_mailboxes, $special_mailboxes, $mbox, $attrib['maxlength']); + $out .= rcmail_render_folder_tree_html($a_mailboxes, $special_mailboxes, $mbox_name, $attrib['maxlength']); // rcube_print_time($mboxlist_start, 'render_folder_tree()'); @@ -162,7 +165,7 @@ function rcmail_build_folder_tree(&$arrFolders, $folder, $delm='/', $path='') // return html for a structured list