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=000077><TR><TD>"
53 "<FONT SIZE=+1 COLOR=\"FFFFFF\""
54 "<B>List subscribe/unsubscribe</B>\n"
55 "</TD></TR></TABLE><BR>\n"
61 if (!strcasecmp(cmd, "subscribe")) {
62 serv_printf("SUBS subscribe|%s|%s|%s|%s/listsub",
70 wprintf("<CENTER><H1>Confirmation request sent</H1>"
71 "You are subscribing <TT>");
73 wprintf("</TT> to the "");
75 wprintf("" mailing list. The listserver has "
76 "sent you an e-mail with one additional "
77 "Web link for you to click on to confirm "
78 "your subscription. This extra step is for "
79 "your protection, as it prevents others from "
80 "being able to subscribe you to lists "
81 "without your consent.<BR><BR>"
82 "Please click on the link which is being "
83 "e-mailed to you and your subscription will "
84 "be confirmed.<BR></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></CENTER>\n"
124 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
134 else if (!strcasecmp(cmd, "confirm")) {
135 serv_printf("SUBS confirm|%s|%s",
141 wprintf("<CENTER><H1>Confirmation successful!</H1>");
144 wprintf("<CENTER><H1>Confirmation failed.</H1>"
145 "This could mean one of two things:<UL>\n"
146 "<LI>You waited too long to confirm your "
147 "subscribe/unsubscribe request (the "
148 "confirmation link is only valid for three "
149 "days)\n<LI>You have <i>already</i> "
150 "successfully confirmed your "
151 "subscribe/unsubscribe request and are "
152 "attempting to do it again.</UL>\n"
153 "The error returned by the server was: "
156 wprintf("%s</CENTER><BR>\n", &buf[4]);
160 * Any other (invalid) command causes the form to be displayed
163 FORM: wprintf("<FORM METHOD=\"POST\" ACTION=\"/listsub\">\n"
167 wprintf("<TR><TD>Name of list</TD><TD>"
168 "<SELECT NAME=\"room\" SIZE=1>\n");
173 while (serv_gets(buf), strcmp(buf, "000")) {
174 extract(sroom, buf, 0);
175 self = extract_int(buf, 4) & QR2_SELFLIST ;
177 wprintf("<OPTION VALUE=\"");
181 wprintf("</OPTION>\n");
188 wprintf("<TR><TD>Your e-mail address</TD><TD>"
189 "<INPUT TYPE=\"text\" NAME=\"email\" "
193 wprintf("\" MAXLENGTH=128></TD></TR>\n");
196 "(If subscribing) preferred format: "
197 "<INPUT TYPE=\"radio\" NAME=\"subtype\""
198 "VALUE=\"list\">One message at a time "
199 "<INPUT TYPE=\"radio\" NAME=\"subtype\""
200 "VALUE=\"digest\" CHECKED>Digest format "
202 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
203 " VALUE=\"subscribe\">\n"
204 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
205 " VALUE=\"unsubscribe\">\n"
209 wprintf("<BR>When you attempt to subscribe or unsubscribe to "
210 "a mailing list, you will receive an e-mail containing"
211 " one additional web link to click on for final "
212 "confirmation. This extra step is for your "
213 "protection, as it prevents others from being able to "
214 "subscribe or unsubscribe you to lists.<BR>\n"
220 * Since this isn't part of a normal Citadel session, we bail right
221 * out without maintaining any state.
223 /* wDumpContent(2); */
224 wprintf("</BODY></HTML>\n");
225 end_webcit_session();