X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders_delete.php;h=c65fcabd4f0a22e5bc528b3eb5d05849e738d8df;hb=30553e2888fa18c4283c366cb48dd4df8bf2f299;hp=f211a4bf57d8f1dd6449c580a8b66600b7f43204;hpb=2aa12d5e029f04fa8c778ec1d3487418d0c3b62d;p=squirrelmail.git
diff --git a/src/folders_delete.php b/src/folders_delete.php
index f211a4bf..c65fcabd 100644
--- a/src/folders_delete.php
+++ b/src/folders_delete.php
@@ -1,41 +1,144 @@
-
- include("../config/config.php");
- include("../functions/strings.php");
- include("../functions/page_header.php");
- include("../functions/imap.php");
-
- $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
-
- // switch to the mailbox, and get the number of messages in it.
- selectMailbox($imapConnection, $mailbox, $numMessages);
-
- // Marks the selected messages ad 'Deleted'
- $j = 0;
- $i = 0;
-
- while ($j < count($msg)) {
- if ($msg[$i]) {
- /** check if they would like to move it to the trash folder or not */
- if ($move_to_trash == true) {
- createFolder($imapConnection, "user.$username.$folder");
- $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
- if ($success == true)
- setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
- } else {
- setMessageFlag($imapConnection, $msg[$i], "Deleted");
- }
- $j++;
- }
- $i++;
- }
-
- if ($auto_expunge == true)
- expungeBox($imapConnection, $mailbox, $numMessages);
-
- // Log out this session
- fputs($imapConnection, "1 logout");
-
- echo "
Return";
-?>
+'._("Click here to go back").'.', $color);
+ exit;
+}
+
+if ( sqgetGlobalVar('backingout', $tmp, SQ_POST) ) {
+ $location = get_location();
+ header ("Location: $location/folders.php");
+ exit;
+}
+
+if( !sqgetGlobalVar('confirmed', $tmp, SQ_POST) ) {
+ displayPageHeader($color, 'None');
+
+ echo '
' .
+ html_tag( 'table', '', 'center', '', 'width="95%" border="0"' ) .
+ html_tag( 'tr',
+ html_tag( 'td', '' . _("Delete Folder") . '', 'center', $color[0] )
+ ) .
+ html_tag( 'tr' ) .
+ html_tag( 'td', '', 'center', $color[4] ) .
+ sprintf(_("Are you sure you want to delete %s?"), str_replace(array(' ','<','>'),array(' ','<','>'),imap_utf7_decode_local($mailbox))).
+ addForm('folders_delete.php', 'post')."
\n". + addHidden('mailbox', $mailbox). + addSubmit(_("Yes"), 'confirmed'). + addSubmit(_("No"), 'backingout'). + '