da8d6707b87e3dbeb267cafdb9206148d166ca76
2 include("../config/config.php");
3 include("../functions/strings.php");
4 include("../functions/page_header.php");
5 include("../functions/display_messages.php");
6 include("../functions/imap.php");
8 include("../src/load_prefs.php");
10 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
12 function putSelectedMessagesIntoString($msg) {
17 // If they have selected nothing msg is size one still, but will be an infinite
18 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
19 while (($j < count($msg)) && ($msg[0])) {
21 if ($firstLoop != true)
22 $selectedMessages .= "&";
26 $selectedMessages .= "selMsg[$j]=$msg[$i]";
34 $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
35 sqimap_mailbox_select($imapConnection, $mailbox);
37 // If the delete button was pressed, the moveButton variable will not be set.
39 displayPageHeader($color, $mailbox);
40 if (is_array($msg) == 1) {
41 // Marks the selected messages ad 'Deleted'
45 // If they have selected nothing msg is size one still, but will be an infinite
46 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
47 while ($j < count($msg)) {
49 sqimap_messages_delete($imapConnection, $msg[$i], $msg[$i], $mailbox);
54 messages_deleted_message($mailbox, $sort, $startMessage, $color);
56 error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
58 } else { // Move messages
59 displayPageHeader($color, $mailbox);
60 // lets check to see if they selected any messages
61 if (is_array($msg) == 1) {
65 // If they have selected nothing msg is size one still, but will be an infinite
66 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
67 while ($j < count($msg)) {
69 /** check if they would like to move it to the trash folder or not */
70 $success = sqimap_messages_copy($imapConnection, $msg[$i], $msg[$i], $targetMailbox);
72 sqimap_messages_flag($imapConnection, $msg[$i], $msg[$i], "Deleted");
77 if ($auto_expunge == true)
78 sqimap_mailbox_expunge($imapConnection, $mailbox, $numMessages);
80 messages_moved_message($mailbox, $sort, $startMessage, $color);
82 error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
86 // Log out this session
87 sqimap_logout($imapConnection);