X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fmove_messages.php;h=c5f4c837d9bc53913160a24f89604c368755d9df;hb=aeee871f74027b914f78e231b587572051a95e91;hp=5852a8eb6ab96332267748a943af27e2872e1bc8;hpb=213b188d9bb7e380b10b51fd900430dca8ec1f78;p=squirrelmail.git diff --git a/src/move_messages.php b/src/move_messages.php index 5852a8eb..c5f4c837 100644 --- a/src/move_messages.php +++ b/src/move_messages.php @@ -1,23 +1,27 @@ -
- - include("../config/config.php"); - include("../functions/mailbox.php"); - include("../functions/strings.php"); - include("../functions/page_header.php"); +"; - } - function putSelectedMessagesIntoString($msg) { $j = 0; $i = 0; $firstLoop = true; - // If they have selected nothing msg is size one still, but will be an infinite - // loop because we never increment j. so check to see if msg[0] is set or not to fix this. + // If they have selected nothing msg is size one still, but will + // be an infinite loop because we never increment j. so check to + // see if msg[0] is set or not to fix this. while (($j < count($msg)) && ($msg[0])) { if ($msg[$i]) { if ($firstLoop != true) @@ -32,18 +36,23 @@ $i++; } } - - - $imapConnection = loginToImapServer($username, $key, $imapServerAddress); - // switch to the mailbox, and get the number of messages in it. - selectMailbox($imapConnection, $mailbox, $numMessages, $imapServerAddress); + $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + sqimap_mailbox_select($imapConnection, $mailbox); - // If the delete button was pressed, the moveButton variable will not be set. - if (!$moveButton) { - displayPageHeader($mailbox); + // expunge-on-demand if user isn't using move_to_trash or auto_expunge + if(isset($expungeButton)) { + sqimap_mailbox_expunge($imapConnection, $mailbox, true); + $location = get_location(); + if ($where && $what) + header ("Location: $location/search.php?mailbox=".urlencode($mailbox)."&what=".urlencode($what)."&where=".urlencode($where)); + else + header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=". urlencode($mailbox)); + } + // undelete messages if user isn't using move_to_trash or auto_expunge + elseif(isset($undeleteButton)) { if (is_array($msg) == 1) { - // Marks the selected messages ad 'Deleted' + // Removes \Deleted flag from selected messages $j = 0; $i = 0; @@ -51,17 +60,51 @@ // loop because we never increment j. so check to see if msg[0] is set or not to fix this. while ($j < count($msg)) { if ($msg[$i]) { - deleteMessages($imapConnection, $msg[$i], $msg[$i], $numMessages, $trash_folder, $move_to_trash, $auto_expunge, $mailbox); + sqimap_messages_remove_flag ($imapConnection, $msg[$i], $msg[$i], "Deleted"); $j++; } $i++; } - messages_deleted_message($mailbox, $sort, $startMessage); + $location = get_location(); + + if ($where && $what) + header ("Location: $location/search.php?mailbox=".urlencode($mailbox)."&what=".urlencode($what)."&where=".urlencode($where)); + else + header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=". urlencode($mailbox)); } else { - echo "