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 // echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
19 function putSelectedMessagesIntoString($msg) {
24 // If they have selected nothing msg is size one still, but will
25 // be an infinite loop because we never increment j. so check to
26 // see if msg[0] is set or not to fix this.
27 while (($j < count($msg)) && ($msg[0])) {
29 if ($firstLoop != true)
30 $selectedMessages .= "&";
34 $selectedMessages .= "selMsg[$j]=$msg[$i]";
42 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
43 sqimap_mailbox_select($imapConnection, $mailbox);
45 // If the delete button was pressed, the moveButton variable will not be set.
47 // displayPageHeader($color, $mailbox);
48 if (is_array($msg) == 1) {
49 // Marks the selected messages ad 'Deleted'
53 // If they have selected nothing msg is size one still, but will be an infinite
54 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
55 while ($j < count($msg)) {
57 sqimap_messages_delete($imapConnection, $msg[$i], $msg[$i], $mailbox);
63 sqimap_mailbox_expunge($imapConnection, $mailbox);
66 header ("Location: right_main.php?PHPSESSID=$PHPSESSID");
68 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
69 displayPageHeader($color, $mailbox);
70 messages_deleted_message($mailbox, $sort, $startMessage, $color);
73 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
74 displayPageHeader($color, $mailbox);
75 error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
77 } else { // Move messages
78 // displayPageHeader($color, $mailbox);
79 // lets check to see if they selected any messages
80 if (is_array($msg) == 1) {
84 // If they have selected nothing msg is size one still, but will be an infinite
85 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
86 while ($j < count($msg)) {
88 /** check if they would like to move it to the trash folder or not */
89 sqimap_messages_copy($imapConnection, $msg[$i], $msg[$i], $targetMailbox);
90 sqimap_messages_flag($imapConnection, $msg[$i], $msg[$i], "Deleted");
95 if ($auto_expunge == true)
96 sqimap_mailbox_expunge($imapConnection, $mailbox);
99 header ("Location: right_main.php?PHPSESSID=$PHPSESSID");
101 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
102 displayPageHeader($color, $mailbox);
103 messages_moved_message($mailbox, $sort, $startMessage, $color);
106 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
107 displayPageHeader($color, $mailbox);
108 error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
112 // Log out this session
113 sqimap_logout($imapConnection);