4 * Web forms for handling mailing list subscribe/unsubscribe requests.
13 * List subscription handling
22 char escaped_email[256];
23 char escaped_room[256];
29 strcpy(WC->wc_fullname, "");
30 strcpy(WC->wc_username, "");
31 strcpy(WC->wc_password, "");
32 strcpy(WC->wc_roomname, "");
34 output_headers(1, 0, 0, 1, 1, 0);
37 wprintf("<HTML><HEAD>\n"
38 "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\" />\n"
39 "<link href=\"static/webcit.css\" rel=\"stylesheet\" type=\"text/css\">\n"
42 wprintf(_("List subscription"));
43 wprintf("</TITLE></HEAD><BODY>\n");
45 strcpy(cmd, bstr("cmd"));
46 strcpy(room, bstr("room"));
47 strcpy(token, bstr("token"));
48 strcpy(email, bstr("email"));
49 strcpy(subtype, bstr("subtype"));
52 "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
53 "<SPAN CLASS=\"titlebar\">");
54 wprintf(_("List subscribe/unsubscribe"));
55 wprintf("</SPAN></TD></TR></TABLE><br />\n");
60 if (!strcasecmp(cmd, "subscribe")) {
61 serv_printf("SUBS subscribe|%s|%s|%s|%s://%s/listsub",
65 (is_https ? "https" : "http"),
68 serv_getln(buf, sizeof buf);
70 stresc(escaped_email, email, 0, 0);
71 stresc(escaped_room, room, 0, 0);
73 wprintf("<CENTER><H1>");
74 wprintf(_("Confirmation request sent"));
76 wprintf(_("You are subscribing <TT>%s"
77 "</TT> to the <b>%s</b> mailing list. "
79 "sent you an e-mail with one additional "
80 "Web link for you to click on to confirm "
81 "your subscription. This extra step is for "
82 "your protection, as it prevents others from "
83 "being able to subscribe you to lists "
84 "without your consent.<br /><br />"
85 "Please click on the link which is being "
86 "e-mailed to you and your subscription will "
87 "be confirmed.<br />\n"),
88 escaped_email, escaped_room);
89 wprintf("<a href=\"listsub\">%s</A></CENTER>\n", _("Go back..."));
92 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
93 "</FONT><br /><br />\n",
100 * Unsubscribe command
102 else if (!strcasecmp(cmd, "unsubscribe")) {
103 serv_printf("SUBS unsubscribe|%s|%s|%s://%s/listsub",
106 (is_https ? "https" : "http"),
109 serv_getln(buf, sizeof buf);
111 wprintf("<CENTER><H1>Confirmation request sent</H1>"
112 "You are unsubscribing <TT>");
114 wprintf("</TT> from the "");
116 wprintf("" mailing list. The listserver has "
117 "sent you an e-mail with one additional "
118 "Web link for you to click on to confirm "
119 "your unsubscription. This extra step is for "
120 "your protection, as it prevents others from "
121 "being able to unsubscribe you from "
122 "lists without your consent.<br /><br />"
123 "Please click on the link which is being "
124 "e-mailed to you and your unsubscription will "
125 "be confirmed.<br />\n"
126 "<a href=\"listsub\">Back...</A></CENTER>\n"
130 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
131 "</FONT><br /><br />\n",
140 else if (!strcasecmp(cmd, "confirm")) {
141 serv_printf("SUBS confirm|%s|%s",
145 serv_getln(buf, sizeof buf);
147 wprintf("<CENTER><H1>Confirmation successful!</H1>");
150 wprintf("<CENTER><H1>Confirmation failed.</H1>"
151 "This could mean one of two things:<UL>\n"
152 "<LI>You waited too long to confirm your "
153 "subscribe/unsubscribe request (the "
154 "confirmation link is only valid for three "
155 "days)\n<LI>You have <i>already</i> "
156 "successfully confirmed your "
157 "subscribe/unsubscribe request and are "
158 "attempting to do it again.</UL>\n"
159 "The error returned by the server was: "
162 wprintf("%s</CENTER><br />\n", &buf[4]);
166 * Any other (invalid) command causes the form to be displayed
169 FORM: wprintf("<FORM METHOD=\"POST\" action=\"listsub\">\n"
173 wprintf("<TR><TD>Name of list</TD><TD>"
174 "<SELECT NAME=\"room\" SIZE=1>\n");
177 serv_getln(buf, sizeof buf);
179 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
180 extract_token(sroom, buf, 0, '|', sizeof sroom);
181 self = extract_int(buf, 4) & QR2_SELFLIST ;
183 wprintf("<OPTION VALUE=\"");
187 wprintf("</OPTION>\n");
194 wprintf("<TR><TD>Your e-mail address</TD><TD>"
195 "<INPUT TYPE=\"text\" NAME=\"email\" "
199 wprintf("\" MAXLENGTH=128></TD></TR>\n");
202 "(If subscribing) preferred format: "
203 "<INPUT TYPE=\"radio\" NAME=\"subtype\""
204 "VALUE=\"list\">One message at a time "
205 "<INPUT TYPE=\"radio\" NAME=\"subtype\""
206 "VALUE=\"digest\" CHECKED>Digest format "
208 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
209 " VALUE=\"subscribe\">\n"
210 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
211 " VALUE=\"unsubscribe\">\n"
215 wprintf("<br />When you attempt to subscribe or unsubscribe to "
216 "a mailing list, you will receive an e-mail containing"
217 " one additional web link to click on for final "
218 "confirmation. This extra step is for your "
219 "protection, as it prevents others from being able to "
220 "subscribe or unsubscribe you to lists.<br />\n"
225 wprintf("</BODY></HTML>\n");
227 end_webcit_session();