X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=1f86f92c7ec89d7a9904f830a4357c7a19caa64e;hb=5917742752bea11a547aeba6e4102dd3655b4800;hp=e51d47e90f42c604398b46568433d189e2de8994;hpb=813eba2f5f4695bd30b895cd148658f3b90bf120;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index e51d47e9..1f86f92c 100644 --- a/src/folders.php +++ b/src/folders.php @@ -1,9 +1,16 @@ -\n"; echo " \n"; - echo " "; echo _("Folders"); - echo "\n"; echo " \n"; echo "\n"; - $imapConnection = sqimap_login ($username, $key, $imapServerAddress, 0); + $imapConnection = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 0); $boxes = sqimap_mailbox_list($imapConnection); + /** Cyrus Folder Options**/ +//Creates the Sent and Trash folder + if (($sent_create == "true") || ($trash_create == "true")) { + if ($sent_create == "true") { + sqimap_mailbox_create ($imapConnection, $sent_folder, ""); + } + if ($trash_create == "true") { + sqimap_mailbox_create ($imapConnection, $trash_folder, ""); + } + +//Major hack, need to right a funtion to check and if mailbox is subscribed to + sqimap_subscribe($imapConnection, "INBOX"); + echo "

"; + echo _("Mailboxes Created Successfully!"); + echo "
"; + echo _("Click here"); + echo " "; + echo _("to continue."); + echo "
"; + echo ""; + + exit; + } + +//display form option for creating Sent and Trash folder + if ($imap_server_type == "cyrus") { + if ((!sqimap_mailbox_exists ($imapConnection, $sent_folder)) || (!sqimap_mailbox_exists ($imapConnection, $trash_folder))) { + echo "\n"; + echo ""; + echo "\n"; + } + } + } + /** DELETING 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 "
\n"; + if (!sqimap_mailbox_exists ($imapConnection, $sent_folder)) { + echo _("Create Sent") . "
\n"; + } + if (!sqimap_mailbox_exists ($imapConnection, $trash_folder)){ + echo _("Create Trash") . "
\n"; + echo ""; + echo "
\n"; - echo ""; + echo ""; echo "\n"; + } else { + echo _("No mailboxes found") . "

"; } - echo "\n"; - echo "\n"; - echo "

\n"; /** CREATING FOLDERS **/ - echo ""; + echo ""; echo "
\n"; /** RENAMING FOLDERS **/ - echo ""; + echo ""; echo "\n"; + } else { + echo _("No mailboxes found") . "

"; + } + $boxes_sub = $boxes; + + /** UNSUBSCRIBE FOLDERS **/ + echo ""; + echo "\n"; + } else { + echo _("No mailboxes found") . "

"; + } + $boxes_sub = $boxes; + + /** SUBSCRIBE TO FOLDERS **/ + + echo "
"; + echo "
"; echo _("Delete Folder"); - echo "
"; - echo "
\n"; - echo "\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 " \n"; + echo "\n"; + echo "

"; + echo "
"; echo _("Create Folder"); - echo "
"; - echo "
\n"; + echo "\n"; echo "
\n"; - echo ""; echo _("as a subfolder of"); - echo "
"; - echo "\n"; if ($default_sub_of_inbox == false) echo "
\n"; - echo ""; if ($show_contain_subfolders_option) { - echo "  "; + echo "  "; echo _("Let this folder contain subfolders"); - echo "
"; + echo "
"; } - echo "
\n"; + echo "\n"; echo "

"; + echo "
"; echo _("Rename a Folder"); - echo "
"; - echo "
\n"; - echo "\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 " \n"; + echo "\n"; + echo "
"; + echo _("Unsubscribe/Subscribe"); + echo "
"; + if ($count_special_folders < count($boxes)) { + echo "
\n"; + echo "\n"; + echo "\n"; + echo "
"; + if ($count_special_folders <= count($boxes)) { + $imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1); + $boxes_all = sqimap_mailbox_list_all ($imap_stream); + + echo "
\n"; + echo ""; + echo "\n"; + echo "

\n"; + } else { + echo _("No mailboxes found") . "

"; } - echo "\n"; - echo "\n"; - echo "
\n"; ?>