From f16d469a04803a848c774e7f4f52ce8ffd99793c Mon Sep 17 00:00:00 2001 From: nehresma Date: Fri, 11 Feb 2000 22:30:18 +0000 Subject: [PATCH] fixed a couple of bugs in folder manipulation, in particular: - creating of folders wasn't using the folder delimeter - deleting of folders was broken - renaming folders didn't keep you subscribed to the folder on Cyrus - the left frame wasn't checking the right thing when looking to see if a folder was a special folder or not. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@210 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/folders_create.php | 2 +- src/folders_rename_do.php | 39 ++++----------------------------------- src/left_main.php | 2 +- 3 files changed, 6 insertions(+), 37 deletions(-) diff --git a/src/folders_create.php b/src/folders_create.php index 4a722b38..0c3fc9d6 100644 --- a/src/folders_create.php +++ b/src/folders_create.php @@ -27,7 +27,7 @@ if (trim($subfolder) == "[ None ]") { createFolder($imapConnection, "$folder_name"); } else { - createFolder($imapConnection, "$subfolder$folder_name"); + createFolder($imapConnection, "$subfolder$dm$folder_name"); } fputs($imapConnection, "1 logout\n"); diff --git a/src/folders_rename_do.php b/src/folders_rename_do.php index 68444932..7af8579c 100644 --- a/src/folders_rename_do.php +++ b/src/folders_rename_do.php @@ -23,42 +23,11 @@ fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\n"); $data = imapReadData($imapConnection, ".", true, $a, $b); -/* fputs ($imapConnection, ". RENAME \"$old_name\" \"$mailbox\"\n"; + // Renaming a folder doesn't renames the folder but leaves you unsubscribed + // at least on Cyrus IMAP servers. + fputs ($imapConnection, "sub SUBSCRIBE $newone\n"); + $data = imapReadData($imapConnection, "sub", true, $a, $b); - selectMailbox($imapConnection, $orig, $numMessages); - getFolderList($imapConnection, $boxesFormatted, $boxesUnformatted, $boxesRaw); - - $mailbox = "$subfolder.$new_name"; - $old_name = substr($orig, strrpos($orig, ".")+1, strlen($orig)); - $old_parent = substr($orig, 0, strrpos($orig, ".")); - - for ($i = 0; $i < count($boxesUnformatted); $i++) { - if (substr($boxesUnformatted[$i], 0, strlen($orig)) == $orig) { - $after = substr($boxesUnformatted[$i], strlen($orig)+1, strlen($boxesUnformatted[$i])); - selectMailbox($imapConnection, $boxesUnformatted[$i], $numMessages); - if (strlen($after) > 0) { - createFolder($imapConnection, "$mailbox.$after"); - if ($numMessages > 0) - $success = copyMessages($imapConnection, 1, $numMessages, "$mailbox.$after"); - else - $success = true; - - if ($success == true) - removeFolder($imapConnection, "$boxesUnformatted[$i]"); - } - else { - createFolder($imapConnection, "$mailbox"); - if ($numMessages > 0) - $success = copyMessages($imapConnection, 1, $numMessages, "$mailbox"); - else - $success = true; - - if ($success == true) - removeFolder($imapConnection, "$boxesUnformatted[$i]"); - } - } - } -*/ /** Log out this session **/ fputs($imapConnection, "1 logout"); diff --git a/src/left_main.php b/src/left_main.php index 9cbe1b37..6172858a 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -33,7 +33,7 @@ $special_color = false; for ($i = 0; $i < count($special_folders); $i++) { - if (($special_folders[$i] == $mailbox) && ($use_special_folder_color == true)) + if (($special_folders[$i] == $real_box) && ($use_special_folder_color == true)) $special_color = true; } -- 2.25.1