X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=1f86f92c7ec89d7a9904f830a4357c7a19caa64e;hb=5917742752bea11a547aeba6e4102dd3655b4800;hp=1084ba334272f79f1c512bbcd96775433ad350f4;hpb=1f97f59a54ac78a293ecb3004c1d5dddc08a1ea6;p=squirrelmail.git diff --git a/src/folders.php b/src/folders.php index 1084ba33..1f86f92c 100644 --- a/src/folders.php +++ b/src/folders.php @@ -1,4 +1,6 @@ -\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") . "

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

"; + } + $boxes_sub = $boxes; + + /** SUBSCRIBE TO FOLDERS **/ + + echo "
"; @@ -41,7 +88,7 @@ } if ($count_special_folders < count($boxes)) { - echo "
\n"; + echo "\n"; echo "
"; - echo "\n"; + echo "\n"; echo "
\n"; echo _("as a subfolder of"); echo "
"; @@ -125,7 +172,7 @@ echo "
"; if ($count_special_folders < count($boxes)) { - echo "\n"; + 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") . "

";