X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders_rename_do.php;h=5c0c3937d6b0519297a4af7bd356f200858bc330;hb=0fa230016e399929e51d8e007b1509421424c7de;hp=0366c728edeee13052f22dde057ee6adf8a1ebae;hpb=d068c0ec5447e8f373ebd536b08ed902c00de0f5;p=squirrelmail.git diff --git a/src/folders_rename_do.php b/src/folders_rename_do.php index 0366c728..5c0c3937 100644 --- a/src/folders_rename_do.php +++ b/src/folders_rename_do.php @@ -1,43 +1,80 @@ - - if (!isset($config_php)) - include("../config/config.php"); - if (!isset($strings_php)) - include("../functions/strings.php"); - if (!isset($page_header_php)) - include("../functions/page_header.php"); - if (!isset($imap_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 "