+ echo "</SELECT></TT>\n";
+ echo "<INPUT TYPE=SUBMIT VALUE=\"";
+ echo _("Rename");
+ echo "\">\n";
+ echo "</FORM></TD></TR>\n";
+ } else {
+ echo _("No mailboxes found") . "<br><br></td></tr>";
+ }
+ $boxes_sub = $boxes;
+
+ echo "<tr><td bgcolor=\"$color[4]\"> </td></tr></table>\n";
+
+ /** UNSUBSCRIBE FOLDERS **/
+ echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER cellpadding=2 cellspacing=0 border=0>\n";
+ echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER colspan=3>";
+ echo _("Unsubscribe") . "/" . _("Subscribe");
+ echo "</TD></TR>";
+ echo "<TR><TD BGCOLOR=\"$color[0]\" width=49% ALIGN=CENTER>";
+ 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))
+ {
+ $box = $boxes[$i]["unformatted-dm"];
+ $box2 = replace_spaces($boxes[$i]["formatted"]);
+ echo " <OPTION VALUE=\"$box\">$box2\n";
+ }
+ }
+ echo "</SELECT></TT><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;
+
+ echo "<td bgcolor=\"$color[9]\" width=2%> </td>";
+
+ /** SUBSCRIBE TO FOLDERS **/
+ echo "<TD BGCOLOR=\"$color[0]\" widtn=49% 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]["formatted"];
+ $q++;
+ }