X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=5c023af17970c7edd122449e9bd31e29ebd2e64c;hb=565020a5098bcf897fbbd1d2a2723849e8dfd732;hp=3e7f28f0544b020fd1097f06801ac2935518850b;hpb=32b3d87eb50fd8a021cc5711aae022532a8cad12;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index 3e7f28f0..5c023af1 100644 --- a/src/folders.php +++ b/src/folders.php @@ -1,268 +1,294 @@ - - 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 _("Special Folder Options"); - echo " | |
"; - echo _("In order for SquirrelMail to provide the full set of options you need to create the special folders listed below. Just click the check box and hit the create button."); - 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] = imap_utf7_decode_local($boxes_all[$i]["unformatted-disp"]);
+ $q++;
+ }
+}
+sqimap_logout($imap_stream);
+
+if ($box && $box2) {
+ echo " "; + echo "\n"; + echo " |