eab4901e1f1f4823d7345d0a3fd5dfdd17a54a2d
2 include("../config/config.php");
3 include("../functions/mailbox.php");
4 include("../functions/strings.php");
5 include("../functions/page_header.php");
6 include("../functions/display_messages.php");
7 include("../functions/imap.php");
9 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
11 function putSelectedMessagesIntoString($msg) {
16 // If they have selected nothing msg is size one still, but will be an infinite
17 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
18 while (($j < count($msg)) && ($msg[0])) {
20 if ($firstLoop != true)
21 $selectedMessages .= "&";
25 $selectedMessages .= "selMsg[$j]=$msg[$i]";
33 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
35 // switch to the mailbox, and get the number of messages in it.
36 selectMailbox($imapConnection, $mailbox, $numMessages, $imapServerAddress);
38 // If the delete button was pressed, the moveButton variable will not be set.
40 displayPageHeader($color, $mailbox);
41 if (is_array($msg) == 1) {
42 // Marks the selected messages ad 'Deleted'
46 // If they have selected nothing msg is size one still, but will be an infinite
47 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
48 while ($j < count($msg)) {
50 deleteMessages($imapConnection, $msg[$i], $msg[$i], $numMessages, $trash_folder, $move_to_trash, $auto_expunge, $mailbox);
55 messages_deleted_message($mailbox, $sort, $startMessage, $color);
57 error_message("No messages were selected.", $mailbox, $sort, $startMessage, $color);
59 } else { // Move messages
60 displayPageHeader($color, $mailbox);
61 // lets check to see if they selected any messages
62 if (is_array($msg) == 1) {
66 // If they have selected nothing msg is size one still, but will be an infinite
67 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
68 while ($j < count($msg)) {
70 /** check if they would like to move it to the trash folder or not */
71 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $targetMailbox);
73 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
78 if ($auto_expunge == true)
79 expungeBox($imapConnection, $mailbox, $numMessages);
81 messages_moved_message($mailbox, $sort, $startMessage, $color);
83 error_message("No messages were selected.", $mailbox, $sort, $startMessage, $color);
87 // Log out this session
88 fputs($imapConnection, "1 logout");