Added minimum GNU License
[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 if ($method == "sub") {
31 $mailbox = trim($mailbox);
32 sqimap_subscribe ($imapConnection, $mailbox);
33 } else {
34 sqimap_unsubscribe ($imapConnection, $mailbox);
35 }
36
37 displayPageHeader($color, "None");
38 echo "<BR><BR><BR><CENTER><B>";
39 if ($method == "sub") {
40 echo _("Subscribed Successfully!");
41 echo "</B><BR><BR>";
42 echo _("You have been successfully subscribed.");
43 } else {
44 echo _("Unsubscribed Successfully!");
45 echo "</B><BR><BR>";
46 echo _("You have been successfully unsubscribed.");
47 }
48 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
49 echo _("Click here");
50 echo "</A> ";
51 echo _("to continue.");
52 echo "</CENTER>";
53 echo "</BODY></HTML>";
54 ?>
55