4 * Web forms for handling mailing list subscribe/unsubscribe requests.
13 * List subscription handling
27 strcpy(WC->wc_username, "");
28 strcpy(WC->wc_password, "");
29 strcpy(WC->wc_roomname, "");
31 wprintf("<HTML><HEAD><TITLE>List subscription</TITLE></HEAD><BODY>\n");
33 strcpy(cmd, bstr("cmd"));
34 strcpy(room, bstr("room"));
35 strcpy(token, bstr("token"));
36 strcpy(email, bstr("email"));
37 strcpy(subtype, bstr("subtype"));
40 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
41 "<SPAN CLASS=\"titlebar\">List subscribe/unsubscribe</SPAN>\n"
42 "</TD></TR></TABLE><br />\n"
48 if (!strcasecmp(cmd, "subscribe")) {
49 serv_printf("SUBS subscribe|%s|%s|%s|%s/listsub",
55 serv_getln(buf, sizeof buf);
57 wprintf("<CENTER><H1>Confirmation request sent</H1>"
58 "You are subscribing <TT>");
60 wprintf("</TT> to the "");
62 wprintf("" mailing list. The listserver has "
63 "sent you an e-mail with one additional "
64 "Web link for you to click on to confirm "
65 "your subscription. This extra step is for "
66 "your protection, as it prevents others from "
67 "being able to subscribe you to lists "
68 "without your consent.<br /><br />"
69 "Please click on the link which is being "
70 "e-mailed to you and your subscription will "
71 "be confirmed.<br />\n"
72 "<A HREF=\"/listsub\">Back...</A></CENTER>\n"
76 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
77 "</FONT><br /><br />\n",
86 else if (!strcasecmp(cmd, "unsubscribe")) {
87 serv_printf("SUBS unsubscribe|%s|%s|%s/listsub",
92 serv_getln(buf, sizeof buf);
94 wprintf("<CENTER><H1>Confirmation request sent</H1>"
95 "You are unsubscribing <TT>");
97 wprintf("</TT> from the "");
99 wprintf("" mailing list. The listserver has "
100 "sent you an e-mail with one additional "
101 "Web link for you to click on to confirm "
102 "your unsubscription. This extra step is for "
103 "your protection, as it prevents others from "
104 "being able to unsubscribe you from "
105 "lists without your consent.<br /><br />"
106 "Please click on the link which is being "
107 "e-mailed to you and your unsubscription will "
108 "be confirmed.<br />\n"
109 "<A HREF=\"/listsub\">Back...</A></CENTER>\n"
113 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
114 "</FONT><br /><br />\n",
123 else if (!strcasecmp(cmd, "confirm")) {
124 serv_printf("SUBS confirm|%s|%s",
128 serv_getln(buf, sizeof buf);
130 wprintf("<CENTER><H1>Confirmation successful!</H1>");
133 wprintf("<CENTER><H1>Confirmation failed.</H1>"
134 "This could mean one of two things:<UL>\n"
135 "<LI>You waited too long to confirm your "
136 "subscribe/unsubscribe request (the "
137 "confirmation link is only valid for three "
138 "days)\n<LI>You have <i>already</i> "
139 "successfully confirmed your "
140 "subscribe/unsubscribe request and are "
141 "attempting to do it again.</UL>\n"
142 "The error returned by the server was: "
145 wprintf("%s</CENTER><br />\n", &buf[4]);
149 * Any other (invalid) command causes the form to be displayed
152 FORM: wprintf("<FORM METHOD=\"POST\" ACTION=\"/listsub\">\n"
156 wprintf("<TR><TD>Name of list</TD><TD>"
157 "<SELECT NAME=\"room\" SIZE=1>\n");
160 serv_getln(buf, sizeof buf);
162 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
163 extract_token(sroom, buf, 0, '|', sizeof sroom);
164 self = extract_int(buf, 4) & QR2_SELFLIST ;
166 wprintf("<OPTION VALUE=\"");
170 wprintf("</OPTION>\n");
177 wprintf("<TR><TD>Your e-mail address</TD><TD>"
178 "<INPUT TYPE=\"text\" NAME=\"email\" "
182 wprintf("\" MAXLENGTH=128></TD></TR>\n");
185 "(If subscribing) preferred format: "
186 "<INPUT TYPE=\"radio\" NAME=\"subtype\""
187 "VALUE=\"list\">One message at a time "
188 "<INPUT TYPE=\"radio\" NAME=\"subtype\""
189 "VALUE=\"digest\" CHECKED>Digest format "
191 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
192 " VALUE=\"subscribe\">\n"
193 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
194 " VALUE=\"unsubscribe\">\n"
198 wprintf("<br />When you attempt to subscribe or unsubscribe to "
199 "a mailing list, you will receive an e-mail containing"
200 " one additional web link to click on for final "
201 "confirmation. This extra step is for your "
202 "protection, as it prevents others from being able to "
203 "subscribe or unsubscribe you to lists.<br />\n"
209 * Since this isn't part of a normal Citadel session, we bail right
210 * out without maintaining any state.
212 /* wDumpContent(2); */
213 wprintf("</BODY></HTML>\n");
214 end_webcit_session();