* 'unsubscribe' command (but not 'confirm unsubscribe')
authorArt Cancro <ajc@citadel.org>
Thu, 22 Aug 2002 03:55:47 +0000 (03:55 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 22 Aug 2002 03:55:47 +0000 (03:55 +0000)
webcit/ChangeLog
webcit/context_loop.c
webcit/listsub.c

index de7e7cea0b87d91fe1d7ae2a2430aa1064377fb6..2a7feeee7611bfaeabfcd6dc036c4e1893d25c2c 100644 (file)
@@ -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 <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 6cad89f9b05428da318d36c2b4ca288af920c0ed..5f67f93859d8af908764c26e0784e02c90b4cefa 100644 (file)
@@ -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;
 
        /*
index 8d7fd116b50aec5ea554e3c851e4f9d517b508fc..3f927a5b178e11df9a64f38587c6c1b4f6ecf021 100644 (file)
@@ -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.<BR><BR>"
+                               "being able to subscribe you to lists "
+                               "without your consent.<BR><BR>"
                                "Please click on the link which is being "
                                "e-mailed to you and your subscription will "
                                "be confirmed.<BR></CENTER>\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("<CENTER><H1>Confirmation request sent</H1>"
+                               "You are unsubscribing <TT>");
+                       escputs(email);
+                       wprintf("</TT> from the &quot;");
+                       escputs(room);
+                       wprintf("&quot; 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.<BR><BR>"
+                               "Please click on the link which is being "
+                               "e-mailed to you and your unsubscription will "
+                               "be confirmed.<BR></CENTER>\n"
+                       );
+               }
+               else {
+                       wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
+                               "</FONT><BR><BR>\n",
+                               &buf[4]);
+                       goto FORM;
+               }
+       }
+
        /* 
         * Confirm command
         */