+ if ($count_special_folders < count($boxes)) {
+ echo "<FORM ACTION=\"folders_rename_getname.php?PHPSESSID=$PHPSESSID\" METHOD=\"POST\">\n";
+ echo "<TT><SELECT NAME=old>\n";
+ for ($i = 0; $i < count($boxes); $i++) {
+ $use_folder = true;
+ for ($p = 0; $p < count($special_folders); $p++) {
+ if ($boxes[$i]["unformatted"] == $special_folders[$p]) {
+ $use_folder = false;
+ } else if (substr($boxes[$i]["unformatted"], 0, strlen($trash_folder)) == $trash_folder) {
+ $use_folder = false;
+ }
+ }
+ if ($use_folder == true) {
+ $box = $boxes[$i]["unformatted-dm"];
+ $box2 = replace_spaces($boxes[$i]["formatted"]);
+ echo " <OPTION VALUE=\"$box\">$box2\n";
+ }
+ }
+ 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;
+
+ /** UNSUBSCRIBE FOLDERS **/
+ echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
+ echo _("Unsubscribe/Subscribe");
+ echo "</B></TD></TR>";
+ echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+ if ($count_special_folders < count($boxes)) {
+ echo "<FORM ACTION=\"folders_subscribe.php?PHPSESSID=$PHPSESSID&method=unsub\" METHOD=\"POST\">\n";
+ echo "<TT><SELECT NAME=mailbox>\n";
+ for ($i = 0; $i < count($boxes); $i++) {
+ $use_folder = true;
+ for ($p = 0; $p < count($special_folders); $p++) {
+ if ($boxes[$i]["unformatted"] == $special_folders[$p]) {
+ $use_folder = false;
+ } else if (substr($boxes[$i]["unformatted"], 0, strlen($trash_folder)) == $trash_folder) {
+ $use_folder = false;
+ }
+ }
+ if ($use_folder == true) {
+ $box = $boxes[$i]["unformatted-dm"];
+ $box2 = replace_spaces($boxes[$i]["formatted"]);
+ echo " <OPTION VALUE=\"$box\">$box2\n";
+ }
+ }
+ echo "</SELECT></TT>\n";
+ echo "<INPUT TYPE=SUBMIT VALUE=\"";
+ echo _("Unsubscribe");
+ echo "\">\n";
+ echo "</FORM></TD></TR>\n";
+ } else {
+ echo _("No mailboxes found") . "<br><br></td></tr>";
+ }
+ $boxes_sub = $boxes;
+
+ /** SUBSCRIBE TO FOLDERS **/
+
+ echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+ if ($count_special_folders <= count($boxes)) {
+ $imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1);
+ $boxes_all = sqimap_mailbox_list_all ($imap_stream);
+
+ echo "<FORM ACTION=\"folders_subscribe.php?PHPSESSID=$PHPSESSID&method=sub\" METHOD=\"POST\">\n";
+ echo "<tt><select name=mailbox>";
+ for ($i = 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;
+ }
+ }
+ if ($use_folder == true) {
+ $box = $boxes_all[$i]["unformatted-dm"];
+ $box2 = replace_spaces($boxes_all[$i]["formatted"]);
+ echo " <OPTION VALUE=\"$box\">$box2\n";