X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders_delete.php;h=0f4ac3e98657a32a2bfdfcfef5ee88b38e41badb;hb=5296b8ef6d5764d790c74fdce42b2f245c4621ed;hp=0561c920f8a281a884c89a3bf98c86da4c8da565;hpb=907165cad70ac37852b5bfbb095c309571a5c035;p=squirrelmail.git
diff --git a/src/folders_delete.php b/src/folders_delete.php
index 0561c920..0f4ac3e9 100644
--- a/src/folders_delete.php
+++ b/src/folders_delete.php
@@ -1,49 +1,142 @@
-
- include("../config/config.php");
- include("../functions/strings.php");
- include("../functions/page_header.php");
- include("../functions/imap.php");
- include("../functions/mailbox.php");
-
- $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
- selectMailbox($imapConnection, $mailbox, $numMessages);
- getFolderList($imapConnection, $boxesFormatted, $boxesUnformatted);
-
- /** Lets start removing the folders and messages **/
- if ($move_to_trash == true) { /** if they wish to move messages to the trash **/
- /** Creates the subfolders under $trash_folder **/
- for ($i = 0; $i < count($boxesUnformatted); $i++) {
- if (substr($boxesUnformatted[$i], 0, strlen($mailbox)) == $mailbox) {
- $folderWithoutINBOX = getFolderNameMinusINBOX($boxesUnformatted[$i]);
- createFolder($imapConnection, "$trash_folder.$folderWithoutINBOX");
- }
- }
- for ($i = 0; $i < count($boxesUnformatted); $i++) {
- if (substr($boxesUnformatted[$i], 0, strlen($mailbox)) == $mailbox) {
- selectMailbox($imapConnection, $boxesUnformatted[$i], $numMessages);
- $folder = getFolderNameMinusINBOX($boxesUnformatted[$i]);
-
- if ($numMessages > 0)
- $success = copyMessages($imapConnection, 1, $numMessages, "$trash_folder.$folder");
- else
- $success = true;
-
- if ($success == true)
- removeFolder($imapConnection, "$boxesUnformatted[$i]");
- }
- }
- } else { /** if they do NOT wish to move messages to the trash **/
- for ($i = 0; $i < count($boxesUnformatted); $i++) {
- if (substr($boxesUnformatted[$i], 0, strlen($mailbox)) == $mailbox) {
- removeFolder($imapConnection, "$boxesUnformatted[$i]");
- }
- }
- }
-
- /** Log out this session **/
- fputs($imapConnection, "1 logout");
-
- echo "
Return";
-?>
+'._("Click here to go back").'.', $color);
+ exit;
+}
+
+if (isset($_POST['backingout'])) {
+ $location = get_location();
+ header ("Location: $location/folders.php");
+ exit;
+}
+
+if(!isset($_POST['confirmed'])) {
+ 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?"), $mailbox).
+ '