X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders_rename_do.php;h=79175d1b379224f1d83a15d5ec62c98f1ab9d088;hb=439166c1f3a86f2713c3a380e965bc977a3c3b52;hp=b5d04d04bfbd0717474c9d3228ba305a024a097a;hpb=813eba2f5f4695bd30b895cd148658f3b90bf120;p=squirrelmail.git diff --git a/src/folders_rename_do.php b/src/folders_rename_do.php index b5d04d04..79175d1b 100644 --- a/src/folders_rename_do.php +++ b/src/folders_rename_do.php @@ -1,39 +1,51 @@ - - 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 "