X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=015a862cc21788beb64411a7279ea0f0fd62b6e1;hb=854000c01b0a890c69ce818a00517acb35e1857a;hp=24eaa84420bc2d52e67dff2abdfc2844706e9566;hpb=895905c0f766ea03e85deab260b4bb1522dd0e3c;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index 24eaa844..015a862c 100644 --- a/src/folders.php +++ b/src/folders.php @@ -1,24 +1,24 @@ @@ -26,240 +26,248 @@
-
+
\n"; - } - $imapConnection = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 0); - $boxes = sqimap_mailbox_list($imapConnection); - - /** DELETING FOLDERS **/ - echo "
| \n";
+} else {
+ echo _("No folders were found to unsubscribe from!") . "";
+}
+$boxes_sub = $boxes;
+
+/** SUBSCRIBE TO FOLDERS **/
+echo "";
+$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++;
+ }
+}
+sqimap_logout($imap_stream);
+
+if ($box && $box2) {
+ echo " "; + echo "\n"; + echo " |