X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=015a862cc21788beb64411a7279ea0f0fd62b6e1;hb=854000c01b0a890c69ce818a00517acb35e1857a;hp=e4290a25aae0ef694ef1773710c7a53d8cf4a589;hpb=44e502e498eed9f136b0769fc3cd71787f9ac232;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index e4290a25..015a862c 100644 --- a/src/folders.php +++ b/src/folders.php @@ -1,208 +1,281 @@ - - session_start(); - - if (!isset($config_php)) - include("../config/config.php"); - if (!isset($strings_php)) - include("../functions/strings.php"); - if (!isset($page_header_php)) - include("../functions/page_header.php"); - if (!isset($imap_php)) - include("../functions/imap.php"); - if (!isset($array_php)) - include("../functions/array.php"); - - include("../src/load_prefs.php"); - - echo "
\n"; - - displayPageHeader($color, "None"); - - echo "\n"; - echo _("Folders"); - echo " |
"; - echo _("Delete Folder"); - echo " | |
";
- $count_special_folders = 0;
- for ($i = 0; $i < count($special_folders); $i++) {
- for ($p = 0; $p < count($special_folders); $p++) {
- if ($boxes[$i]["unformatted"] == $special_folders[$p]) {
- $count_special_folders++;
- }
- }
- }
-
- if ($count_special_folders < count($boxes)) {
- echo " | |
"; - echo _("Create Folder"); - echo " | |
";
- echo " | |
"; - echo _("Rename a Folder"); - echo " | |
"; - if ($count_special_folders < count($boxes)) { - echo " | |
"; - echo _("Unsubscribe/Subscribe"); - echo " | |
"; - if ($count_special_folders < count($boxes)) { - 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 " |