Tyler: This is not very original but should do the trick
[squirrelmail.git] / src / folders_subscribe.php
CommitLineData
59177427 1<?php
895905c0 2
ef870322 3 /**
4 ** folders_subscribe.php
5 **
895905c0 6 ** Copyright (c) 1999-2001 The SquirrelMail development team
ef870322 7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 **
9 ** Subscribe and unsubcribe form folders.
10 ** Called from folders.php
245a6892 11 **
12 ** $Id$
ef870322 13 **/
14
ff8a98e7 15 require_once('../src/validate.php');
16 require_once('../functions/imap.php');
17 require_once('../functions/display_messages.php');
11353192 18
19 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
11353192 20
1195c340 21 $location = get_location();
895905c0 22 if ($method == 'sub') {
e9f8ea4e 23 for ($i=0; $i < count($mailbox); $i++) {
24 $mailbox[$i] = trim($mailbox[$i]);
25 sqimap_subscribe ($imapConnection, $mailbox[$i]);
26 header("Location: $location/folders.php?success=subscribe");
27 }
11353192 28 } else {
e9f8ea4e 29 for ($i=0; $i < count($mailbox); $i++) {
30 $mailbox[$i] = trim($mailbox[$i]);
31 sqimap_unsubscribe ($imapConnection, $mailbox[$i]);
32 header("Location: $location/folders.php?success=unsubscribe");
33 }
11353192 34 }
f1177e37 35 if (!isset($mailbox)) {
36 header("Location: $location/folders.php");
37 }
1195c340 38 sqimap_logout($imapConnection);
11353192 39
1195c340 40 /*
2d367c68 41 displayPageHeader($color, 'None');
11353192 42 echo "<BR><BR><BR><CENTER><B>";
43 if ($method == "sub") {
44 echo _("Subscribed Successfully!");
45 echo "</B><BR><BR>";
46 echo _("You have been successfully subscribed.");
47 } else {
48 echo _("Unsubscribed Successfully!");
49 echo "</B><BR><BR>";
50 echo _("You have been successfully unsubscribed.");
51 }
9f2215a1 52 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
11353192 53 echo _("Click here");
54 echo "</A> ";
55 echo _("to continue.");
56 echo "</CENTER>";
57 echo "</BODY></HTML>";
1195c340 58 */
f1177e37 59?>