-/** RENAMING FOLDERS **/
-echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>".
- _("Rename a Folder").
- "</B></TD></TR>".
- "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-if ($count_special_folders < count($boxes)) {
- echo "<FORM ACTION=\"folders_rename_getname.php\" METHOD=\"POST\">\n"
- . "<TT><SELECT NAME=old>\n"
- . ' <OPTION VALUE="">[ ' . _("Select a folder") . " ]</OPTION>\n";
- for ($i = 0; $i < count($boxes); $i++) {
- $use_folder = true;
-
- if ((strtolower($boxes[$i]['unformatted']) != 'inbox') &&
- ($boxes[$i]['unformatted'] != $trash_folder) &&
- ($boxes[$i]['unformatted'] != $sent_folder) &&
- ($boxes[$i]['unformatted'] != $draft_folder)) {
- $box = $boxes[$i]['unformatted-dm'];
-
- $box2 = str_replace(' ', ' ', $boxes[$i]['unformatted-disp']);
- if (strtolower($imap_server_type) != 'courier' || strtolower($box) != 'inbox.trash') {
- echo "<OPTION VALUE=\"$box\">$box2</option>\n";
- }
- }
- }
- echo "</SELECT></TT>\n".
- "<INPUT TYPE=SUBMIT VALUE=\"".
- _("Rename").
- "\">\n".
- "</FORM></TD></TR>\n";
-} else {
- echo _("No folders found") . "<br><br></td></tr>";
-}
-$boxes_sub = $boxes;
-
-echo "<tr><td bgcolor=\"$color[4]\"> </td></tr>\n";
-
-/** DELETING FOLDERS **/
-echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
-echo _("Delete Folder");
-echo "</B></TD></TR>";
-echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-
-if ($count_special_folders < count($boxes)) {
- echo "<FORM ACTION=\"folders_delete.php\" METHOD=\"POST\">\n"
- . "<TT><SELECT NAME=mailbox>\n"
- . ' <OPTION VALUE="">[ ' . _("Select a folder") . " ]</OPTION>\n";
- for ($i = 0; $i < count($boxes); $i++) {
- $use_folder = true;
- if ((strtolower($boxes[$i]['unformatted']) != 'inbox') &&
- ($boxes[$i]['unformatted'] != $trash_folder) &&
- ($boxes[$i]['unformatted'] != $sent_folder) &&
- ($boxes[$i]['unformatted'] != $draft_folder) &&
- ((strtolower($imap_server_type) != 'courier') ||
- (strtolower($boxes[$i]['unformatted']) != 'inbox.trash'))) {
- $box = $boxes[$i]['unformatted-dm'];
- $box2 = str_replace(' ', ' ', $boxes[$i]['unformatted-disp']);
- echo " <OPTION VALUE=\"$box\">$box2</option>\n";
- }
- }
- echo "</SELECT></TT>\n";
- echo "<INPUT TYPE=SUBMIT VALUE=\"";
- echo _("Delete");
- echo "\">\n";
- echo "</FORM></TD></TR>\n";
-} else {
- echo _("No folders found") . "<br><br></td><tr>";
-}
-echo "<tr><td bgcolor=\"$color[4]\"> </td></tr></table>\n";
-
-/** UNSUBSCRIBE FOLDERS **/
-echo "<TABLE WIDTH=\"70%\" COLS=2 ALIGN=CENTER cellpadding=4 cellspacing=0 border=0>\n";
-echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER colspan=2><B>";
-echo _("Unsubscribe") . "/" . _("Subscribe");
-echo "</B></TD></TR>\n";
-echo "<TR><TD BGCOLOR=\"$color[0]\" width=\"50%\" ALIGN=CENTER>\n";
-if ($count_special_folders < count($boxes)) {
- echo "<FORM ACTION=\"folders_subscribe.php?method=unsub\" METHOD=\"POST\">\n";
- echo "<TT><SELECT NAME=\"mailbox[]\" multiple size=8>\n";
- for ($i = 0; $i < count($boxes); $i++) {
- $use_folder = true;
- if ((strtolower($boxes[$i]["unformatted"]) != "inbox") &&
- ($boxes[$i]["unformatted"] != $trash_folder) &&
- ($boxes[$i]["unformatted"] != $sent_folder) &&
- ($boxes[$i]["unformatted"] != $draft_folder)) {
- $box = $boxes[$i]["unformatted-dm"];
- $box2 = str_replace(' ', ' ', $boxes[$i]["unformatted-disp"]);
- echo " <OPTION VALUE=\"$box\">$box2\n";
- }
- }
- echo "</SELECT></TT><br><br>\n";
- echo "<INPUT TYPE=SUBMIT VALUE=\"";
- echo _("Unsubscribe");
- echo "\">\n";
- echo "</FORM></TD>\n";
-} else {
- echo _("No folders were found to unsubscribe from!") . "</td>";
-}
-$boxes_sub = $boxes;
-
-/** SUBSCRIBE TO FOLDERS **/
-echo "<TD BGCOLOR=\"$color[0]\" width=\"50%\" ALIGN=CENTER>";
-$imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1);
-$boxes_all = sqimap_mailbox_list_all ($imap_stream);
-
-$box = "";
-$box2 = "";
-for ($i = 0, $q = 0; $i < count($boxes_all); $i++) {
- $use_folder = true;
- for ($p = 0; $p < count ($boxes); $p++) {
- if ($boxes_all[$i]["unformatted"] == $boxes[$p]["unformatted"]) {
- $use_folder = false;
- continue;
- } else if ($boxes_all[$i]["unformatted-dm"] == $folder_prefix) {
- $use_folder = false;
- }
- }
- if ($use_folder == true) {
- $box[$q] = $boxes_all[$i]["unformatted-dm"];
- $box2[$q] = $boxes_all[$i]["unformatted-disp"];
- $q++;