3 ** folders_subscribe.php
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 ** Subscribe and unsubcribe form folders.
9 ** Called from folders.php
14 if (!isset($config_php))
15 include("../config/config.php");
16 if (!isset($strings_php))
17 include("../functions/strings.php");
18 if (!isset($page_header_php))
19 include("../functions/page_header.php");
20 if (!isset($imap_php))
21 include("../functions/imap.php");
22 if (!isset($display_messages_php))
23 include("../functions/display_messages.php");
25 include("../src/load_prefs.php");
27 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
28 $dm = sqimap_get_delimiter($imapConnection);
30 $location = get_location();
31 if ($method == "sub") {
32 $mailbox = trim($mailbox);
33 sqimap_subscribe ($imapConnection, $mailbox);
34 header("Location: $location/folders.php?success=subscribe");
36 sqimap_unsubscribe ($imapConnection, $mailbox);
37 header("Location: $location/folders.php?success=unsubscribe");
39 sqimap_logout($imapConnection);
42 displayPageHeader($color, "None");
43 echo "<BR><BR><BR><CENTER><B>";
44 if ($method == "sub") {
45 echo _("Subscribed Successfully!");
47 echo _("You have been successfully subscribed.");
49 echo _("Unsubscribed Successfully!");
51 echo _("You have been successfully unsubscribed.");
53 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
56 echo _("to continue.");
58 echo "</BODY></HTML>";