X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=63562be77a7ff94c4625bbbce056d24ab57b22c8;hb=753ce83805e6dd765c65eabaff2d962e0006f8c2;hp=069857b53495f87c30f5b280f89634717895db9c;hpb=37578167cf36077ca8bcb395191bd96a069046a7;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index 069857b5..63562be7 100644 --- a/src/folders.php +++ b/src/folders.php @@ -1,227 +1,287 @@ - - 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 " | |
"; - if ($count_special_folders < count($boxes)) { - $imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1); - $boxes = sqimap_mailbox_list_all ($imap_stream); - - 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 " |