2 if (!isset($config_php))
3 include("../config/config.php");
4 if (!isset($strings_php))
5 include("../functions/strings.php");
6 if (!isset($page_header_php))
7 include("../functions/page_header.php");
9 include("../functions/imap.php");
11 include("../src/load_prefs.php");
13 $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
14 $dm = sqimap_get_delimiter($imapConnection);
16 if (strpos($orig, $dm))
17 $old_dir = substr($orig, 0, strrpos($orig, $dm));
22 $newone = "$old_dir$dm$new_name";
24 $newone = "$new_name";
26 fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\n");
27 $data = sqimap_read_data($imapConnection, ".", true, $a, $b);
29 // Renaming a folder doesn't renames the folder but leaves you unsubscribed
30 // at least on Cyrus IMAP servers.
31 fputs ($imapConnection, "sub UNSUBSCRIBE \"$orig\"\n");
32 fputs ($imapConnection, "sub SUBSCRIBE \"$newone\"\n");
33 $data = sqimap_read_data($imapConnection, "sub", true, $a, $b);
35 /** Log out this session **/
36 fputs($imapConnection, "1 logout");
38 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
39 echo "<BR><BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
42 echo "</BODY></HTML>";