From c1b0b859188c2eee353d12d3a659efc36448084d Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 22 Aug 2002 03:55:47 +0000 Subject: [PATCH] * 'unsubscribe' command (but not 'confirm unsubscribe') --- webcit/ChangeLog | 4 ++++ webcit/context_loop.c | 1 + webcit/listsub.c | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index de7e7cea0..2a7feeee7 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 323.61 2002/08/22 03:55:47 ajc +* 'unsubscribe' command (but not 'confirm unsubscribe') + Revision 323.60 2002/08/21 21:58:37 ajc * Completed self-service list subscription via web. (Still need to implement unsubscribe.) @@ -907,3 +910,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 6cad89f9b..5f67f9385 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -270,6 +270,7 @@ void context_loop(int sock) */ if (!strncasecmp(buf, "GET ", 4)) strcpy(buf, &buf[4]); else if (!strncasecmp(buf, "HEAD ", 5)) strcpy(buf, &buf[5]); + else if (!strncasecmp(buf, "POST ", 5)) strcpy(buf, &buf[5]); if (buf[1]==' ') buf[1]=0; /* diff --git a/webcit/listsub.c b/webcit/listsub.c index 8d7fd116b..3f927a5b1 100644 --- a/webcit/listsub.c +++ b/webcit/listsub.c @@ -76,7 +76,8 @@ void do_listsub(void) "Web link for you to click on to confirm " "your subscription. This extra step is for " "your protection, as it prevents others from " - "being able to subscribe you to lists.

" + "being able to subscribe you to lists " + "without your consent.

" "Please click on the link which is being " "e-mailed to you and your subscription will " "be confirmed.
\n" @@ -90,6 +91,42 @@ void do_listsub(void) } } + /* + * Unsubscribe command + */ + else if (!strcasecmp(cmd, "unsubscribe")) { + serv_printf("SUBS unsubscribe|%s|%s|%s/listsub", + room, + email, + WC->http_host + ); + serv_gets(buf); + if (buf[0] == '2') { + wprintf("

Confirmation request sent

" + "You are unsubscribing "); + escputs(email); + wprintf(" from the ""); + escputs(room); + wprintf("" mailing list. The listserver has " + "sent you an e-mail with one additional " + "Web link for you to click on to confirm " + "your unsubscription. This extra step is for " + "your protection, as it prevents others from " + "being able to unsubscribe you from " + "lists without your consent.

" + "Please click on the link which is being " + "e-mailed to you and your unsubscription will " + "be confirmed.
\n" + ); + } + else { + wprintf("ERROR: %s" + "

\n", + &buf[4]); + goto FORM; + } + } + /* * Confirm command */ -- 2.30.2