* 'unsubscribe' command (but not 'confirm unsubscribe')
[citadel.git] / webcit / listsub.c
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
         */