}
}
if ($use_folder == true) {
- $box = $boxes[$i]["unformatted"];
+ $box = $boxes[$i]["unformatted-dm"];
$box2 = replace_spaces($boxes[$i]["formatted"]);
echo " <OPTION VALUE=\"$box\">$box2\n";
}
// 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);
+ if ($isfolder) {
+ $newone = $newone.$dm;
+ $orig = $orig.$dm;
+ }
+
+ sqimap_unsubscribe($imapConnection, $orig);
+ sqimap_subscribe($imapConnection, $newone);
/** Log out this session **/
- fputs($imapConnection, "1 logout");
+ sqimap_logout($imapConnection);
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
echo "<BR><BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
include("../src/load_prefs.php");
$imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
- sqimap_mailbox_select($imapConnection, $old);
$dm = sqimap_get_delimiter($imapConnection);
+ if (substr($old, strlen($old) - strlen($dm)) == $dm) {
+ $isfolder = true;
+ $old = substr($old, 0, strlen($old) - 1);
+ }
+
if (strpos($old, $dm)) {
$old_name = substr($old, strrpos($old, $dm)+1, strlen($old));
$old_parent = substr($old, 0, strrpos($old, $dm));
echo "<FORM ACTION=folders_rename_do.php METHOD=POST>\n";
echo _("New name:");
echo " <INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
+ if ($isfolder)
+ echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">";
echo "<INPUT TYPE=HIDDEN NAME=orig VALUE=\"$old\">";
echo "<INPUT TYPE=SUBMIT VALUE=\"";
echo _("Submit");