-<?
+<?php
+ /**
+ ** folders_subscribe.php
+ **
+ ** Copyright (c) 1999-2000 The SquirrelMail development team
+ ** Licensed under the GNU GPL. For full terms see the file COPYING.
+ **
+ ** Subscribe and unsubcribe form folders.
+ ** Called from folders.php
+ **/
+
+ session_start();
+
if (!isset($config_php))
include("../config/config.php");
if (!isset($strings_php))
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$dm = sqimap_get_delimiter($imapConnection);
+ $location = get_location();
if ($method == "sub") {
- $mailbox = trim($mailbox);
- sqimap_subscribe ($imapConnection, $mailbox);
+ for ($i=0; $i < count($mailbox); $i++) {
+ $mailbox[$i] = trim($mailbox[$i]);
+ sqimap_subscribe ($imapConnection, $mailbox[$i]);
+ header("Location: $location/folders.php?success=subscribe");
+ }
} else {
- sqimap_unsubscribe ($imapConnection, $mailbox);
+ for ($i=0; $i < count($mailbox); $i++) {
+ $mailbox[$i] = trim($mailbox[$i]);
+ sqimap_unsubscribe ($imapConnection, $mailbox[$i]);
+ header("Location: $location/folders.php?success=unsubscribe");
+ }
}
+ sqimap_logout($imapConnection);
- echo "<html><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+ /*
displayPageHeader($color, "None");
echo "<BR><BR><BR><CENTER><B>";
if ($method == "sub") {
echo _("to continue.");
echo "</CENTER>";
echo "</BODY></HTML>";
+ */
?>