- added a bunch of sqimap_logout's where none existed
[squirrelmail.git] / src / folders_subscribe.php
1 <?php
2 /**
3 ** folders_subscribe.php
4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
8 ** Subscribe and unsubcribe form folders.
9 ** Called from folders.php
10 **/
11
12 session_start();
13
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");
24
25 include("../src/load_prefs.php");
26
27 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
28 $dm = sqimap_get_delimiter($imapConnection);
29
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");
35 } else {
36 sqimap_unsubscribe ($imapConnection, $mailbox);
37 header("Location: $location/folders.php?success=unsubscribe");
38 }
39 sqimap_logout($imapConnection);
40
41 /*
42 displayPageHeader($color, "None");
43 echo "<BR><BR><BR><CENTER><B>";
44 if ($method == "sub") {
45 echo _("Subscribed Successfully!");
46 echo "</B><BR><BR>";
47 echo _("You have been successfully subscribed.");
48 } else {
49 echo _("Unsubscribed Successfully!");
50 echo "</B><BR><BR>";
51 echo _("You have been successfully unsubscribed.");
52 }
53 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
54 echo _("Click here");
55 echo "</A> ";
56 echo _("to continue.");
57 echo "</CENTER>";
58 echo "</BODY></HTML>";
59 */
60 ?>
61