updated docs
[squirrelmail.git] / src / folders_subscribe.php
CommitLineData
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
2a32fc83 14 session_start();
15
11353192 16 if (!isset($strings_php))
17 include("../functions/strings.php");
1863670d 18 if (!isset($config_php))
19 include("../config/config.php");
11353192 20 if (!isset($page_header_php))
21 include("../functions/page_header.php");
22 if (!isset($imap_php))
23 include("../functions/imap.php");
24 if (!isset($display_messages_php))
25 include("../functions/display_messages.php");
26
27 include("../src/load_prefs.php");
28
29 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
30 $dm = sqimap_get_delimiter($imapConnection);
31
1195c340 32 $location = get_location();
11353192 33 if ($method == "sub") {
e9f8ea4e 34 for ($i=0; $i < count($mailbox); $i++) {
35 $mailbox[$i] = trim($mailbox[$i]);
36 sqimap_subscribe ($imapConnection, $mailbox[$i]);
37 header("Location: $location/folders.php?success=subscribe");
38 }
11353192 39 } else {
e9f8ea4e 40 for ($i=0; $i < count($mailbox); $i++) {
41 $mailbox[$i] = trim($mailbox[$i]);
42 sqimap_unsubscribe ($imapConnection, $mailbox[$i]);
43 header("Location: $location/folders.php?success=unsubscribe");
44 }
11353192 45 }
1195c340 46 sqimap_logout($imapConnection);
11353192 47
1195c340 48 /*
11353192 49 displayPageHeader($color, "None");
50 echo "<BR><BR><BR><CENTER><B>";
51 if ($method == "sub") {
52 echo _("Subscribed Successfully!");
53 echo "</B><BR><BR>";
54 echo _("You have been successfully subscribed.");
55 } else {
56 echo _("Unsubscribed Successfully!");
57 echo "</B><BR><BR>";
58 echo _("You have been successfully unsubscribed.");
59 }
9f2215a1 60 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
11353192 61 echo _("Click here");
62 echo "</A> ";
63 echo _("to continue.");
64 echo "</CENTER>";
65 echo "</BODY></HTML>";
1195c340 66 */
11353192 67?>
68