1 <HTML
><BODY TEXT
="#000000" BGCOLOR
="#FFFFFF" LINK
="#0000EE" VLINK
="#0000EE" ALINK
="#0000EE">
3 include("../config/config.php");
4 include("../functions/mailbox.php");
5 include("../functions/strings.php");
6 include("../functions/page_header.php");
7 include("../functions/display_messages.php");
8 include("../functions/imap.php");
10 for ($i = 0; $i < count($msg); $i++
) {
11 echo "MSG: $msg[$i]<BR>";
14 function putSelectedMessagesIntoString($msg) {
19 // If they have selected nothing msg is size one still, but will be an infinite
20 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
21 while (($j < count($msg)) && ($msg[0])) {
23 if ($firstLoop != true)
24 $selectedMessages .= "&";
28 $selectedMessages .= "selMsg[$j]=$msg[$i]";
37 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
39 // switch to the mailbox, and get the number of messages in it.
40 selectMailbox($imapConnection, $mailbox, $numMessages, $imapServerAddress);
42 // If the delete button was pressed, the moveButton variable will not be set.
44 displayPageHeader($mailbox);
45 if (is_array($msg) == 1) {
46 // Marks the selected messages ad 'Deleted'
50 // If they have selected nothing msg is size one still, but will be an infinite
51 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
52 while ($j < count($msg)) {
54 deleteMessages($imapConnection, $msg[$i], $msg[$i], $numMessages, $trash_folder, $move_to_trash, $auto_expunge, $mailbox);
59 messages_deleted_message($mailbox, $sort, $startMessage);
61 echo "<BR><BR><CENTER>No messages selected.</CENTER>";
63 } else { // Move messages
64 displayPageHeader($mailbox);
65 // lets check to see if they selected any messages
66 if (is_array($msg) == 1) {
70 // If they have selected nothing msg is size one still, but will be an infinite
71 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
72 while ($j < count($msg)) {
74 /** check if they would like to move it to the trash folder or not */
75 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $targetMailbox);
77 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
82 if ($auto_expunge == true)
83 expungeBox($imapConnection, $mailbox, $numMessages);
85 messages_moved_message($mailbox, $sort, $startMessage);
87 error_message("No messages were selected.", $mailbox, $sort, $startMessage);
91 // Log out this session
92 fputs($imapConnection, "1 logout");