From d7e3602ce1742be4d59094b4fe55161b17b9b668 Mon Sep 17 00:00:00 2001 From: cosworth Date: Mon, 10 Apr 2000 20:42:43 +0000 Subject: [PATCH] Added a more automated way to create Sent and Trash folders since Cyrus doesn't create them during account creation. Also put in a hack to subscribe you to your INBOX as a work around for the fact that Cyrus doesn't have you subscribed to your INBOX automactically. This is all working with the $imap_server_type var, and shouldn't affect any other server type. The options only show up in the folders link if you do not have an INBOX.Sent or a INBOX.Trash. I need to clean up the code, so don't but it seems to work. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@403 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/folders.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/folders.php b/src/folders.php index e4290a25..167993c3 100644 --- a/src/folders.php +++ b/src/folders.php @@ -27,6 +27,47 @@ $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 "
"; -- 2.25.1