9 #include <sys/socket.h>
12 #include <netinet/in.h>
25 * List subscription handling
39 strcpy(WC->wc_username, "");
40 strcpy(WC->wc_password, "");
41 strcpy(WC->wc_roomname, "");
43 wprintf("<HTML><HEAD><TITLE>List subscription</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\">List subscribe/unsubscribe</SPAN>\n"
54 "</TD></TR></TABLE><BR>\n"
60 if (!strcasecmp(cmd, "subscribe")) {
61 serv_printf("SUBS subscribe|%s|%s|%s|%s/listsub",
69 wprintf("<CENTER><H1>Confirmation request sent</H1>"
70 "You are subscribing <TT>");
72 wprintf("</TT> to the "");
74 wprintf("" mailing list. The listserver has "
75 "sent you an e-mail with one additional "
76 "Web link for you to click on to confirm "
77 "your subscription. This extra step is for "
78 "your protection, as it prevents others from "
79 "being able to subscribe you to lists "
80 "without your consent.<BR><BR>"
81 "Please click on the link which is being "
82 "e-mailed to you and your subscription will "
84 "<A HREF=\"/listsub\">Back...</A></CENTER>\n"
88 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
98 else if (!strcasecmp(cmd, "unsubscribe")) {
99 serv_printf("SUBS unsubscribe|%s|%s|%s/listsub",
106 wprintf("<CENTER><H1>Confirmation request sent</H1>"
107 "You are unsubscribing <TT>");
109 wprintf("</TT> from the "");
111 wprintf("" mailing list. The listserver has "
112 "sent you an e-mail with one additional "
113 "Web link for you to click on to confirm "
114 "your unsubscription. This extra step is for "
115 "your protection, as it prevents others from "
116 "being able to unsubscribe you from "
117 "lists without your consent.<BR><BR>"
118 "Please click on the link which is being "
119 "e-mailed to you and your unsubscription will "
120 "be confirmed.<BR>\n"
121 "<A HREF=\"/listsub\">Back...</A></CENTER>\n"
125 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
135 else if (!strcasecmp(cmd, "confirm")) {
136 serv_printf("SUBS confirm|%s|%s",
142 wprintf("<CENTER><H1>Confirmation successful!</H1>");
145 wprintf("<CENTER><H1>Confirmation failed.</H1>"
146 "This could mean one of two things:<UL>\n"
147 "<LI>You waited too long to confirm your "
148 "subscribe/unsubscribe request (the "
149 "confirmation link is only valid for three "
150 "days)\n<LI>You have <i>already</i> "
151 "successfully confirmed your "
152 "subscribe/unsubscribe request and are "
153 "attempting to do it again.</UL>\n"
154 "The error returned by the server was: "
157 wprintf("%s</CENTER><BR>\n", &buf[4]);
161 * Any other (invalid) command causes the form to be displayed
164 FORM: wprintf("<FORM METHOD=\"GET\" ACTION=\"/listsub\">\n"
168 wprintf("<TR><TD>Name of list</TD><TD>"
169 "<SELECT NAME=\"room\" SIZE=1>\n");
174 while (serv_gets(buf), strcmp(buf, "000")) {
175 extract(sroom, buf, 0);
176 self = extract_int(buf, 4) & QR2_SELFLIST ;
178 wprintf("<OPTION VALUE=\"");
182 wprintf("</OPTION>\n");
189 wprintf("<TR><TD>Your e-mail address</TD><TD>"
190 "<INPUT TYPE=\"text\" NAME=\"email\" "
194 wprintf("\" MAXLENGTH=128></TD></TR>\n");
197 "(If subscribing) preferred format: "
198 "<INPUT TYPE=\"radio\" NAME=\"subtype\""
199 "VALUE=\"list\">One message at a time "
200 "<INPUT TYPE=\"radio\" NAME=\"subtype\""
201 "VALUE=\"digest\" CHECKED>Digest format "
203 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
204 " VALUE=\"subscribe\">\n"
205 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
206 " VALUE=\"unsubscribe\">\n"
210 wprintf("<BR>When you attempt to subscribe or unsubscribe to "
211 "a mailing list, you will receive an e-mail containing"
212 " one additional web link to click on for final "
213 "confirmation. This extra step is for your "
214 "protection, as it prevents others from being able to "
215 "subscribe or unsubscribe you to lists.<BR>\n"
221 * Since this isn't part of a normal Citadel session, we bail right
222 * out without maintaining any state.
224 /* wDumpContent(2); */
225 wprintf("</BODY></HTML>\n");
226 end_webcit_session();