Removed dependance upon /dev/null allowing for use Windows/IIS.
[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
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);
19 $dm = sqimap_get_delimiter($imapConnection);
20
1195c340 21 $location = get_location();
11353192 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 }
1195c340 35 sqimap_logout($imapConnection);
11353192 36
1195c340 37 /*
11353192 38 displayPageHeader($color, "None");
39 echo "<BR><BR><BR><CENTER><B>";
40 if ($method == "sub") {
41 echo _("Subscribed Successfully!");
42 echo "</B><BR><BR>";
43 echo _("You have been successfully subscribed.");
44 } else {
45 echo _("Unsubscribed Successfully!");
46 echo "</B><BR><BR>";
47 echo _("You have been successfully unsubscribed.");
48 }
9f2215a1 49 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
11353192 50 echo _("Click here");
51 echo "</A> ";
52 echo _("to continue.");
53 echo "</CENTER>";
54 echo "</BODY></HTML>";
1195c340 55 */
ff8a98e7 56?>