fix for bug #585012
[squirrelmail.git] / src / folders_subscribe.php
CommitLineData
59177427 1<?php
895905c0 2
35586184 3/**
4 * folders_subscribe.php
5 *
15e6162e 6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
35586184 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
11 *
12 * $Id$
13 */
ef870322 14
35586184 15require_once('../src/validate.php');
16require_once('../functions/imap.php');
17require_once('../functions/display_messages.php');
11353192 18
32f4e318 19$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
11353192 20
32f4e318 21$location = get_location();
22if ($method == 'sub') {
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 }
28} else {
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 }
34}
35if (!isset($mailbox)) {
36 header("Location: $location/folders.php");
37}
38sqimap_logout($imapConnection);
11353192 39
32f4e318 40/*
41displayPageHeader($color, 'None');
42echo "<BR><BR><BR><CENTER><B>";
43if ($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}
52echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
53echo _("Click here");
54echo "</A> ";
55echo _("to continue.");
56echo "</CENTER>";
57echo "</BODY></HTML>";
58*/
f1177e37 59?>