* Updated docs to tell the user to read any documentation that came with the
[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 ** $Id$
12 **/
13
14 include ('../src/validate.php');
15 include("../functions/page_header.php");
16 include("../functions/imap.php");
17 include("../functions/display_messages.php");
18 include("../src/load_prefs.php");
19
20 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
21 $dm = sqimap_get_delimiter($imapConnection);
22
23 $location = get_location();
24 if ($method == "sub") {
25 for ($i=0; $i < count($mailbox); $i++) {
26 $mailbox[$i] = trim($mailbox[$i]);
27 sqimap_subscribe ($imapConnection, $mailbox[$i]);
28 header("Location: $location/folders.php?success=subscribe");
29 }
30 } else {
31 for ($i=0; $i < count($mailbox); $i++) {
32 $mailbox[$i] = trim($mailbox[$i]);
33 sqimap_unsubscribe ($imapConnection, $mailbox[$i]);
34 header("Location: $location/folders.php?success=unsubscribe");
35 }
36 }
37 sqimap_logout($imapConnection);
38
39 /*
40 displayPageHeader($color, "None");
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 }
51 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
52 echo _("Click here");
53 echo "</A> ";
54 echo _("to continue.");
55 echo "</CENTER>";
56 echo "</BODY></HTML>";
57 */
58 ?>
59