X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders_rename_do.php;h=8807f6456c2bd9a72a3937e7c142942e143dfabb;hb=d2c47f00c6069f0e42dc1d99f2f23b53a0a7a118;hp=b61b7f8a219b7f6a82a5ec8ba94e680e6abdb74a;hpb=23fc64b344f7a063ace1dbe877cae9052ede79d6;p=squirrelmail.git diff --git a/src/folders_rename_do.php b/src/folders_rename_do.php index b61b7f8a..8807f645 100644 --- a/src/folders_rename_do.php +++ b/src/folders_rename_do.php @@ -1,14 +1,27 @@ -\n"; - echo "

"; - echo _("Return"); - echo ""; - echo ""; -?> + fputs ($imapConnection, sqimap_session_id() . " LIST \"\" \"" . quoteIMAP($newone) . + "*\"\r\n"); + $data = sqimap_read_data($imapConnection, sqimap_session_id(), true, $a, $b); + for ($i=0; $i < count($data); $i++) + { + $name = find_mailbox_name($data[$i]); + if ($name != $newone) // don't try to resubscribe when renaming ab to abc + { + sqimap_unsubscribe($imapConnection, $name); + $name = substr($name, strlen($orig)); + $name = $newone . $name; + sqimap_subscribe($imapConnection, $name); + } + } + /** Log out this session **/ + sqimap_logout($imapConnection); + $location = get_location(); + header ("Location: $location/folders.php?success=rename"); +?> \ No newline at end of file