* Word Wrapping works good
[squirrelmail.git] / src / move_messages.php
CommitLineData
b40316f9 1<?
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");
05207a68 7 include("../functions/imap.php");
b40316f9 8
05207a68 9 echo "<HTML><BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
10 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
b40316f9 11
12 // switch to the mailbox, and get the number of messages in it.
2aa12d5e 13 selectMailbox($imapConnection, $mailbox, $numMessages, $imapServerAddress);
b40316f9 14
05207a68 15 if (strtolower($move_or_delete) == "delete selected messages") {
16 // Marks the selected messages ad 'Deleted'
17 $j = 0;
18 $i = 0;
19 while ($j < count($msg)) {
20 if ($msg[$i]) {
21 /** check if they would like to move it to the trash folder or not */
22 if ($move_to_trash == true) {
23 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
24 if ($success == true)
25 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
26 } else {
27 setMessageFlag($imapConnection, $msg[$i], "Deleted");
28 }
29 $j++;
b40316f9 30 }
05207a68 31 $i++;
b40316f9 32 }
05207a68 33 if ($auto_expunge == true)
34 expungeBox($imapConnection, $mailbox, $numMessages);
35 displayPageHeader($mailbox);
36 messages_deleted_message($mailbox, $sort, $startMessage);
37 } else {
38 echo "Move";
b40316f9 39 }
40
b40316f9 41 // Log out this session
42 fputs($imapConnection, "1 logout");
43
2aa12d5e 44?>