X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Flistsub.c;h=0f4af8ce9042dd81d4dd012534001ad32ca5f6ab;hb=1f494963f66495189901c38c84cbc6d6b3e9f952;hp=f219ffcb832991a5dab979442b4fb72dfbd4b01e;hpb=8c7819e29bd976ec4882075f12480c12dc3691bd;p=citadel.git diff --git a/webcit/listsub.c b/webcit/listsub.c index f219ffcb8..0f4af8ce9 100644 --- a/webcit/listsub.c +++ b/webcit/listsub.c @@ -1,18 +1,13 @@ /* * $Id$ - */ -/** - * \defgroup ListSubForms Web forms for handling mailing list subscribe/unsubscribe requests. - * \ingroup WebcitDisplayItems + * + * Web forms for handling mailing list subscribe/unsubscribe requests. */ -/*@{*/ #include "webcit.h" - - -/** - * \brief List subscription handling +/* + * List subscription handling */ void do_listsub(void) { @@ -28,10 +23,10 @@ void do_listsub(void) int self; char sroom[SIZ]; - strcpy(WC->wc_fullname, ""); - strcpy(WC->wc_username, ""); - strcpy(WC->wc_password, ""); - strcpy(WC->wc_roomname, ""); + FlushStrBuf(WC->wc_fullname); + FlushStrBuf(WC->wc_username); + FlushStrBuf(WC->wc_password); + FlushStrBuf(WC->wc_roomname); output_headers(1, 0, 0, 1, 1, 0); begin_burst(); @@ -50,13 +45,14 @@ void do_listsub(void) strcpy(email, bstr("email")); strcpy(subtype, bstr("subtype")); - wprintf("
" - "
" - ""); - wprintf(_("List subscribe/unsubscribe")); - wprintf("

\n"); + wprintf("
"); + wprintf("
"); - /** + svput("BOXTITLE", WCS_STRING, _("List subscribe/unsubscribe")); + do_template("beginboxx", NULL); + wprintf("

"); + + /* * Subscribe command */ if (!strcasecmp(cmd, "subscribe")) { @@ -65,7 +61,7 @@ void do_listsub(void) email, subtype, (is_https ? "https" : "http"), - WC->http_host + ChrPtr(WC->Hdr->http_host) ); serv_getln(buf, sizeof buf); if (buf[0] == '2') { @@ -98,15 +94,15 @@ void do_listsub(void) } } - /** + /* * Unsubscribe command */ else if (!strcasecmp(cmd, "unsubscribe")) { serv_printf("SUBS unsubscribe|%s|%s|%s://%s/listsub", - room, - email, - (is_https ? "https" : "http"), - WC->http_host + room, + email, + (is_https ? "https" : "http"), + ChrPtr(WC->Hdr->http_host) ); serv_getln(buf, sizeof buf); if (buf[0] == '2') { @@ -136,7 +132,7 @@ void do_listsub(void) } } - /** + /* * Confirm command */ else if (!strcasecmp(cmd, "confirm")) { @@ -164,16 +160,14 @@ void do_listsub(void) wprintf("%s
\n", &buf[4]); } - /** + /* * Any other (invalid) command causes the form to be displayed */ else { -FORM: wprintf("
\n"); - wprintf("\n", WC->nonce); - wprintf("\n"); +FORM: wprintf("\n"); - wprintf("\n"); + wprintf("

\n"); - wprintf("\n"); + wprintf("\" maxlength=128 size=60>

\n"); - wprintf("
Name of list" - "\n"); serv_puts("LPRM"); serv_getln(buf, sizeof buf); @@ -182,39 +176,37 @@ FORM: wprintf("\n"); extract_token(sroom, buf, 0, '|', sizeof sroom); self = extract_int(buf, 4) & QR2_SELFLIST ; if (self) { - wprintf("\n"); + wprintf("\n"); } } } - wprintf("" - "
Your e-mail address" + wprintf("Your e-mail address: " "
" - "(If subscribing) preferred format: " + wprintf("(If subscribing) preferred format: " "One message at a time  " "Digest format  " - "
\n" + "

\n" "\n" "\n" + " VALUE=\"unsubscribe\">

\n" "
\n" ); - wprintf("
When you attempt to subscribe or unsubscribe to " + wprintf("
When you attempt to subscribe or unsubscribe to " "a mailing list, you will receive an e-mail containing" " one additional web link to click on for final " "confirmation. This extra step is for your " @@ -224,6 +216,10 @@ FORM: wprintf("
\n"); } + wprintf("
"); + do_template("endbox", NULL); + wprintf("
"); + wprintf("\n"); wDumpContent(0); end_webcit_session(); @@ -231,4 +227,11 @@ FORM: wprintf("\n"); -/*@}*/ +void +InitModule_LISTSUB +(void) +{ + WebcitAddUrlHandler(HKEY("listsub"), do_listsub, ANONYMOUS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE); + + +}