renamed $mbox so that it will stop interfering with the $_SESSION when register_globals is turned on
| | |
| | | */ |
| | | |
| | | $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()); |
| | |
| | | $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')); |
| | | |
| | | |
| | |
| | | */ |
| | | |
| | | $REMOTE_REQUEST = TRUE; |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | | $mbox_name = $IMAP->get_mailbox_name(); |
| | | |
| | | |
| | | // send EXPUNGE command |
| | |
| | | $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"; |
| | |
| | | |
| | | $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'])) |
| | | { |
| | |
| | | |
| | | // 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'])); |
| | |
| | | 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'); |
| | |
| | | // 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()'); |
| | | |
| | |
| | | |
| | | |
| | | // return html for a structured list <ul> for the mailbox tree |
| | | function rcmail_render_folder_tree_html(&$arrFolders, &$special, &$mbox, $maxlength, $nestLevel=0) |
| | | function rcmail_render_folder_tree_html(&$arrFolders, &$special, &$mbox_name, $maxlength, $nestLevel=0) |
| | | { |
| | | global $JS_OBJECT_NAME, $COMM_PATH, $IMAP, $CONFIG, $OUTPUT; |
| | | |
| | |
| | | } |
| | | |
| | | // add unread message count display |
| | | if ($unread_count = $IMAP->messagecount($folder['id'], 'RECENT', ($folder['id']==$mbox))) |
| | | if ($unread_count = $IMAP->messagecount($folder['id'], 'RECENT', ($folder['id']==$mbox_name))) |
| | | $foldername .= sprintf(' (%d)', $unread_count); |
| | | |
| | | // make folder name safe for ids and class names |
| | |
| | | $class_name, |
| | | $zebra_class, |
| | | $unread_count ? ' unread' : '', |
| | | $folder['id']==$mbox ? ' selected' : '', |
| | | $folder['id']==$mbox_name ? ' selected' : '', |
| | | $COMM_PATH, |
| | | urlencode($folder['id']), |
| | | $JS_OBJECT_NAME, |
| | |
| | | rep_specialchars_output($foldername, 'html', 'all')); |
| | | |
| | | if (!empty($folder['folders'])) |
| | | $out .= "\n<ul>\n" . rcmail_render_folder_tree_html($folder['folders'], $special, $mbox, $maxlength, $nestLevel+1) . "</ul>\n"; |
| | | $out .= "\n<ul>\n" . rcmail_render_folder_tree_html($folder['folders'], $special, $mbox_name, $maxlength, $nestLevel+1) . "</ul>\n"; |
| | | |
| | | $out .= "</li>\n"; |
| | | $idx++; |
| | |
| | | |
| | | |
| | | // return html for a flat list <select> for the mailbox tree |
| | | function rcmail_render_folder_tree_select(&$arrFolders, &$special, &$mbox, $maxlength, $nestLevel=0) |
| | | function rcmail_render_folder_tree_select(&$arrFolders, &$special, &$mbox_name, $maxlength, $nestLevel=0) |
| | | { |
| | | global $IMAP, $OUTPUT; |
| | | |
| | |
| | | rep_specialchars_output($foldername, 'html', 'all')); |
| | | |
| | | if (!empty($folder['folders'])) |
| | | $out .= rcmail_render_folder_tree_select($folder['folders'], $special, $mbox, $maxlength, $nestLevel+1); |
| | | $out .= rcmail_render_folder_tree_select($folder['folders'], $special, $mbox_name, $maxlength, $nestLevel+1); |
| | | |
| | | $idx++; |
| | | } |
| | |
| | | |
| | | if (!empty($a_folders)) |
| | | { |
| | | foreach ($a_folders as $mbox) |
| | | foreach ($a_folders as $mbox_row) |
| | | { |
| | | $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN')); |
| | | $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox_row, $IMAP->messagecount($mbox_row, 'UNSEEN')); |
| | | rcube_remote_response($commands, TRUE); |
| | | } |
| | | } |
| | |
| | | if (!empty($_GET['_search']) && isset($_SESSION['search'][$_GET['_search']])) |
| | | { |
| | | $a_msgs = split(',', $_SESSION['search'][$_GET['_search']]); |
| | | $a_headers = $IMAP->list_header_set($mbox, $a_msgs, NULL, $sort_col, $sort_order); |
| | | $a_headers = $IMAP->list_header_set($mbox_name, $a_msgs, NULL, $sort_col, $sort_order); |
| | | $count = count($a_msgs); |
| | | } |
| | | else |
| | | { |
| | | if ($count = $IMAP->messagecount()) |
| | | $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order); |
| | | $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order); |
| | | } |
| | | |
| | | $unseen = $IMAP->messagecount($mbox, 'UNSEEN', !empty($_GET['_refresh']) ? TRUE : FALSE); |
| | | $unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_GET['_refresh']) ? TRUE : FALSE); |
| | | |
| | | // update message count display |
| | | $pages = ceil($count/$IMAP->page_size); |
| | |
| | | $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text($count)); |
| | | |
| | | // update mailboxlist |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | | $commands .= sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox), $unseen); |
| | | $mbox_name = $IMAP->get_mailbox_name(); |
| | | $commands .= sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_name), $unseen); |
| | | |
| | | |
| | | // add message rows |
| | |
| | | <?php |
| | | |
| | | /* |
| | | +-----------------------------------------------------------------------+ |
| | | | program/steps/mail/mark.inc | |
| | |
| | | $marked = $IMAP->set_flag($_GET['_uid'], $flag); |
| | | if ($marked != -1) |
| | | { |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | | $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN')); |
| | | $mbox_name = $IMAP->get_mailbox_name(); |
| | | $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN')); |
| | | rcube_remote_response($commands); |
| | | } |
| | | } |
| | |
| | | |
| | | // check if mailbox exists |
| | | if (!in_array_nocase($CONFIG['sent_mbox'], $IMAP->list_mailboxes())) |
| | | $mbox = $IMAP->create_mailbox($CONFIG['sent_mbox'], TRUE); |
| | | $sent_folder = $IMAP->create_mailbox($CONFIG['sent_mbox'], TRUE); |
| | | else |
| | | $mbox = TRUE; |
| | | $sent_folder = TRUE; |
| | | |
| | | // append message to sent box |
| | | if ($mbox) |
| | | if ($sent_folder) |
| | | $saved = $IMAP->save_message($CONFIG['sent_mbox'], $header_str."\r\n".$msg_body); |
| | | |
| | | // raise error if saving failed |