4 if (!isset($config_php))
5 include("../config/config.php");
6 if (!isset($strings_php))
7 include("../functions/strings.php");
8 if (!isset($page_header_php))
9 include("../functions/page_header.php");
10 if (!isset($display_messages_php))
11 include("../functions/display_messages.php");
12 if (!isset($imap_php))
13 include("../functions/imap.php");
15 include("../src/load_prefs.php");
17 function putSelectedMessagesIntoString($msg) {
22 // If they have selected nothing msg is size one still, but will
23 // be an infinite loop because we never increment j. so check to
24 // see if msg[0] is set or not to fix this.
25 while (($j < count($msg)) && ($msg[0])) {
27 if ($firstLoop != true)
28 $selectedMessages .= "&";
32 $selectedMessages .= "selMsg[$j]=$msg[$i]";
40 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
41 sqimap_mailbox_select($imapConnection, $mailbox);
43 // If the delete button was pressed, the moveButton variable will not be set.
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 sqimap_messages_delete($imapConnection, $msg[$i], $msg[$i], $mailbox);
60 sqimap_mailbox_expunge($imapConnection, $mailbox);
63 header ("Location: right_main.php");
65 displayPageHeader($color, $mailbox);
66 messages_deleted_message($mailbox, $sort, $startMessage, $color);
69 displayPageHeader($color, $mailbox);
70 error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
72 } else { // Move messages
73 // lets check to see if they selected any messages
74 if (is_array($msg) == 1) {
78 // If they have selected nothing msg is size one still, but will be an infinite
79 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
80 while ($j < count($msg)) {
82 /** check if they would like to move it to the trash folder or not */
83 sqimap_messages_copy($imapConnection, $msg[$i], $msg[$i], $targetMailbox);
84 sqimap_messages_flag($imapConnection, $msg[$i], $msg[$i], "Deleted");
89 if ($auto_expunge == true)
90 sqimap_mailbox_expunge($imapConnection, $mailbox);
93 header ("Location: right_main.php");
95 displayPageHeader($color, $mailbox);
96 messages_moved_message($mailbox, $sort, $startMessage, $color);
99 displayPageHeader($color, $mailbox);
100 error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
104 // Log out this session
105 sqimap_logout($imapConnection);