59177427 |
1 | <?php |
ef870322 |
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 | |
2a32fc83 |
12 | session_start(); |
13 | |
11353192 |
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 | |
1195c340 |
30 | $location = get_location(); |
11353192 |
31 | if ($method == "sub") { |
e9f8ea4e |
32 | for ($i=0; $i < count($mailbox); $i++) { |
33 | $mailbox[$i] = trim($mailbox[$i]); |
34 | sqimap_subscribe ($imapConnection, $mailbox[$i]); |
35 | header("Location: $location/folders.php?success=subscribe"); |
36 | } |
11353192 |
37 | } else { |
e9f8ea4e |
38 | for ($i=0; $i < count($mailbox); $i++) { |
39 | $mailbox[$i] = trim($mailbox[$i]); |
40 | sqimap_unsubscribe ($imapConnection, $mailbox[$i]); |
41 | header("Location: $location/folders.php?success=unsubscribe"); |
42 | } |
11353192 |
43 | } |
1195c340 |
44 | sqimap_logout($imapConnection); |
11353192 |
45 | |
1195c340 |
46 | /* |
11353192 |
47 | displayPageHeader($color, "None"); |
48 | echo "<BR><BR><BR><CENTER><B>"; |
49 | if ($method == "sub") { |
50 | echo _("Subscribed Successfully!"); |
51 | echo "</B><BR><BR>"; |
52 | echo _("You have been successfully subscribed."); |
53 | } else { |
54 | echo _("Unsubscribed Successfully!"); |
55 | echo "</B><BR><BR>"; |
56 | echo _("You have been successfully unsubscribed."); |
57 | } |
9f2215a1 |
58 | echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>"; |
11353192 |
59 | echo _("Click here"); |
60 | echo "</A> "; |
61 | echo _("to continue."); |
62 | echo "</CENTER>"; |
63 | echo "</BODY></HTML>"; |
1195c340 |
64 | */ |
11353192 |
65 | ?> |
66 | |