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|digest|%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 "
83 "be confirmed.<BR></CENTER>\n"
87 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
97 else if (!strcasecmp(cmd, "unsubscribe")) {
98 serv_printf("SUBS unsubscribe|%s|%s|%s/listsub",
105 wprintf("<CENTER><H1>Confirmation request sent</H1>"
106 "You are unsubscribing <TT>");
108 wprintf("</TT> from the "");
110 wprintf("" mailing list. The listserver has "
111 "sent you an e-mail with one additional "
112 "Web link for you to click on to confirm "
113 "your unsubscription. This extra step is for "
114 "your protection, as it prevents others from "
115 "being able to unsubscribe you from "
116 "lists without your consent.<BR><BR>"
117 "Please click on the link which is being "
118 "e-mailed to you and your unsubscription will "
119 "be confirmed.<BR></CENTER>\n"
123 wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
133 else if (!strcasecmp(cmd, "confirm")) {
134 serv_printf("SUBS confirm|%s|%s",
140 wprintf("<CENTER><H1>Confirmation successful!</H1>");
143 wprintf("<CENTER><H1>Confirmation failed.</H1>");
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");
162 while (serv_gets(buf), strcmp(buf, "000")) {
163 extract(sroom, buf, 0);
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 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
186 " VALUE=\"subscribe\">\n"
187 "<INPUT TYPE=\"submit\" NAME=\"cmd\""
188 " VALUE=\"unsubscribe\">\n"
192 wprintf("<BR>When you attempt to subscribe or unsubscribe to "
193 "a mailing list, you will receive an e-mail containing"
194 " one additional web link to click on for final "
195 "confirmation. This extra step is for your "
196 "protection, as it prevents others from being able to "
197 "subscribe or unsubscribe you to lists.<BR>\n"
203 * Since this isn't part of a normal Citadel session, we bail right
204 * out without maintaining any state.
206 /* wDumpContent(2); */
207 wprintf("</BODY></HTML>\n");
208 end_webcit_session();