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 |
245a6892 |
10 | ** |
11 | ** $Id$ |
ef870322 |
12 | **/ |
13 | |
ff8a98e7 |
14 | require_once('../src/validate.php'); |
15 | require_once('../functions/imap.php'); |
16 | require_once('../functions/display_messages.php'); |
11353192 |
17 | |
18 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
11353192 |
19 | |
1195c340 |
20 | $location = get_location(); |
11353192 |
21 | if ($method == "sub") { |
e9f8ea4e |
22 | for ($i=0; $i < count($mailbox); $i++) { |
23 | $mailbox[$i] = trim($mailbox[$i]); |
24 | sqimap_subscribe ($imapConnection, $mailbox[$i]); |
25 | header("Location: $location/folders.php?success=subscribe"); |
26 | } |
11353192 |
27 | } else { |
e9f8ea4e |
28 | for ($i=0; $i < count($mailbox); $i++) { |
29 | $mailbox[$i] = trim($mailbox[$i]); |
30 | sqimap_unsubscribe ($imapConnection, $mailbox[$i]); |
31 | header("Location: $location/folders.php?success=unsubscribe"); |
32 | } |
11353192 |
33 | } |
f1177e37 |
34 | if (!isset($mailbox)) { |
35 | header("Location: $location/folders.php"); |
36 | } |
1195c340 |
37 | sqimap_logout($imapConnection); |
11353192 |
38 | |
1195c340 |
39 | /* |
2d367c68 |
40 | displayPageHeader($color, 'None'); |
11353192 |
41 | echo "<BR><BR><BR><CENTER><B>"; |
42 | if ($method == "sub") { |
43 | echo _("Subscribed Successfully!"); |
44 | echo "</B><BR><BR>"; |
45 | echo _("You have been successfully subscribed."); |
46 | } else { |
47 | echo _("Unsubscribed Successfully!"); |
48 | echo "</B><BR><BR>"; |
49 | echo _("You have been successfully unsubscribed."); |
50 | } |
9f2215a1 |
51 | echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>"; |
11353192 |
52 | echo _("Click here"); |
53 | echo "</A> "; |
54 | echo _("to continue."); |
55 | echo "</CENTER>"; |
56 | echo "</BODY></HTML>"; |
1195c340 |
57 | */ |
f1177e37 |
58 | ?> |