X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders_rename_do.php;h=ff29eb11f954bb56b5aa2307647a9d54fed76882;hb=d4eaadbe7c054eee5d869ff29ffc8775bfcaffe9;hp=b5d04d04bfbd0717474c9d3228ba305a024a097a;hpb=813eba2f5f4695bd30b895cd148658f3b90bf120;p=squirrelmail.git diff --git a/src/folders_rename_do.php b/src/folders_rename_do.php index b5d04d04..ff29eb11 100644 --- a/src/folders_rename_do.php +++ b/src/folders_rename_do.php @@ -1,39 +1,85 @@ - - include("../config/config.php"); - include("../functions/strings.php"); - include("../functions/page_header.php"); - include("../functions/imap.php"); - - include("../src/load_prefs.php"); - - $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0); - $dm = sqimap_get_delimiter($imapConnection); - - if (strpos($orig, $dm)) - $old_dir = substr($orig, 0, strrpos($orig, $dm)); - else - $old_dir = ""; - - if ($old_dir != "") - $newone = "$old_dir$dm$new_name"; - else - $newone = "$new_name"; - - fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\n"); - $data = sqimap_read_data($imapConnection, ".", true, $a, $b); - - // Renaming a folder doesn't renames the folder but leaves you unsubscribed - // at least on Cyrus IMAP servers. - fputs ($imapConnection, "sub UNSUBSCRIBE \"$orig\"\n"); - fputs ($imapConnection, "sub SUBSCRIBE \"$newone\"\n"); - $data = sqimap_read_data($imapConnection, "sub", true, $a, $b); - - /** Log out this session **/ - fputs($imapConnection, "1 logout"); - - echo "
\n"; - echo "