13cfcfa69b21f4f250a66afecb4c21ed7fb9e2f1
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 function putSelectedMessagesIntoString($msg) {
15 // If they have selected nothing msg is size one still, but will be an infinite
16 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
17 while (($j < count($msg)) && ($msg[0])) {
19 if ($firstLoop != true)
20 $selectedMessages .= "&";
24 $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($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 /** check if they would like to move it to the trash folder or not */
51 if ($move_to_trash == true) {
52 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
54 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
56 setMessageFlag($imapConnection, $msg[$i], "Deleted");
62 if ($auto_expunge == true)
63 expungeBox($imapConnection, $mailbox, $numMessages);
64 messages_deleted_message($mailbox, $sort, $startMessage);
66 echo "<BR><BR><CENTER>No messages selected.</CENTER>";
68 } else { // Move messages
69 displayPageHeader($mailbox);
70 // lets check to see if they selected any messages
71 if (is_array($msg) == 1) {
75 // If they have selected nothing msg is size one still, but will be an infinite
76 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
77 while ($j < count($msg)) {
79 /** check if they would like to move it to the trash folder or not */
80 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $targetMailbox);
82 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
87 if ($auto_expunge == true)
88 expungeBox($imapConnection, $mailbox, $numMessages);
90 echo "Messages are moved.<br>";
92 echo "\n<BR><BR><BR>\n";
93 echo "<CENTER>No messages selected.</CENTER>\n";
97 // Log out this session
98 fputs($imapConnection, "1 logout");