]> code.citadel.org Git - citadel.git/blobdiff - webcit/listsub.c
* migrated SUBST stuff to hash
[citadel.git] / webcit / listsub.c
index 87bddb4d200e0c3008758a239caf223f4494555e..ce9b1ed5250a37555f3167242adf42abe826b280 100644 (file)
@@ -2,13 +2,10 @@
  * $Id$
  *
  * Web forms for handling mailing list subscribe/unsubscribe requests.
- *
  */
 
 #include "webcit.h"
 
-
-
 /*
  * List subscription handling
  */
@@ -26,11 +23,19 @@ 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, "");
 
-       wprintf("<HTML><HEAD><TITLE>");
+       output_headers(1, 0, 0, 1, 1, 0);
+       begin_burst();
+
+       wprintf("<HTML><HEAD>\n"
+               "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\" />\n"
+               "<link href=\"static/webcit.css\" rel=\"stylesheet\" type=\"text/css\">\n"
+               "<TITLE>\n"
+       );
        wprintf(_("List subscription"));
        wprintf("</TITLE></HEAD><BODY>\n");
 
@@ -40,11 +45,12 @@ void do_listsub(void)
        strcpy(email, bstr("email"));
        strcpy(subtype, bstr("subtype"));
 
-       wprintf("<CENTER>"
-               "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
-               "<SPAN CLASS=\"titlebar\">");
-       wprintf(_("List subscribe/unsubscribe"));
-       wprintf("</SPAN></TD></TR></TABLE><br />\n");
+       wprintf("<div align=center>");
+       wprintf("<table border=0 width=75%%><tr><td>");
+
+       svput("BOXTITLE", WCS_STRING, _("List subscribe/unsubscribe"));
+       do_template("beginbox");
+       wprintf("<div align=center><br>");
 
        /*
         * Subscribe command
@@ -59,8 +65,8 @@ void do_listsub(void)
                );
                serv_getln(buf, sizeof buf);
                if (buf[0] == '2') {
-                       stresc(escaped_email, email, 0, 0);
-                       stresc(escaped_room, room, 0, 0);
+                       stresc(escaped_email, 256, email, 0, 0);
+                       stresc(escaped_room, 256, room, 0, 0);
 
                        wprintf("<CENTER><H1>");
                        wprintf(_("Confirmation request sent"));
@@ -78,7 +84,7 @@ void do_listsub(void)
                                "e-mailed to you and your subscription will "
                                "be confirmed.<br />\n"),
                                escaped_email, escaped_room);
-                       wprintf("<A HREF=\"/listsub\">%s</A></CENTER>\n", _("Go back..."));
+                       wprintf("<a href=\"listsub\">%s</A></CENTER>\n", _("Go back..."));
                }
                else {
                        wprintf("<FONT SIZE=+1><B>ERROR: %s</B>"
@@ -115,7 +121,7 @@ void do_listsub(void)
                                "Please click on the link which is being "
                                "e-mailed to you and your unsubscription will "
                                "be confirmed.<br />\n"
-                               "<A HREF=\"/listsub\">Back...</A></CENTER>\n"
+                               "<a href=\"listsub\">Back...</A></CENTER>\n"
                        );
                }
                else {
@@ -126,7 +132,7 @@ void do_listsub(void)
                }
        }
 
-       /* 
+       /*
         * Confirm command
         */
        else if (!strcasecmp(cmd, "confirm")) {
@@ -158,12 +164,10 @@ void do_listsub(void)
         * Any other (invalid) command causes the form to be displayed
         */
        else {
-FORM:          wprintf("<FORM METHOD=\"POST\" ACTION=\"/listsub\">\n"
-                       "<TABLE BORDER=0>\n"
-               );
+FORM:          wprintf("<form method=\"POST\" action=\"listsub\">\n");
 
-               wprintf("<TR><TD>Name of list</TD><TD>"
-                       "<SELECT NAME=\"room\" SIZE=1>\n");
+               wprintf("Name of list: "
+                       "<select name=\"room\" size=1>\n");
 
                serv_puts("LPRM");
                serv_getln(buf, sizeof buf);
@@ -172,39 +176,37 @@ FORM:             wprintf("<FORM METHOD=\"POST\" ACTION=\"/listsub\">\n"
                                extract_token(sroom, buf, 0, '|', sizeof sroom);
                                self = extract_int(buf, 4) & QR2_SELFLIST ;
                                if (self) {
-                                       wprintf("<OPTION VALUE=\"");
+                                       wprintf("<option value=\"");
                                        escputs(sroom);
                                        wprintf("\">");
                                        escputs(sroom);
-                                       wprintf("</OPTION>\n");
+                                       wprintf("</option>\n");
                                }
                        }
                }
-               wprintf("</SELECT>"
-                       "</TD></TR>\n");
+               wprintf("</select><br><br>\n");
 
-               wprintf("<TR><TD>Your e-mail address</TD><TD>"
+               wprintf("Your e-mail address: "
                        "<INPUT TYPE=\"text\" NAME=\"email\" "
                        "VALUE=\""
                );
                escputs(email);
-               wprintf("\" MAXLENGTH=128></TD></TR>\n");
-
-               wprintf("</TABLE>"
-                       "(If subscribing) preferred format: "
-                       "<INPUT TYPE=\"radio\" NAME=\"subtype\""
-                       "VALUE=\"list\">One message at a time&nbsp; "
-                       "<INPUT TYPE=\"radio\" NAME=\"subtype\""
-                       "VALUE=\"digest\" CHECKED>Digest format&nbsp; "
-                       "<br />\n"
+               wprintf("\" maxlength=128 size=60><br><br>\n");
+
+               wprintf("(If subscribing) preferred format: "
+                       "<INPUT TYPE=\"radio\" NAME=\"subtype\" "
+                       "VALUE=\"list\" CHECKED>One message at a time&nbsp; "
+                       "<INPUT TYPE=\"radio\" NAME=\"subtype\" "
+                       "VALUE=\"digest\">Digest format&nbsp; "
+                       "<br><br>\n"
                        "<INPUT TYPE=\"submit\" NAME=\"cmd\""
                        " VALUE=\"subscribe\">\n"
                        "<INPUT TYPE=\"submit\" NAME=\"cmd\""
-                       " VALUE=\"unsubscribe\">\n"
+                       " VALUE=\"unsubscribe\"><br><br>\n"
                        "</FORM>\n"
                );
 
-               wprintf("<br />When you attempt to subscribe or unsubscribe to "
+               wprintf("<hr>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 "
@@ -214,11 +216,11 @@ FORM:             wprintf("<FORM METHOD=\"POST\" ACTION=\"/listsub\">\n"
 
        }
 
-       /*
-        * Since this isn't part of a normal Citadel session, we bail right
-        * out without maintaining any state.
-        */
-       /* wDumpContent(2); */
+       wprintf("</div>");
+       do_template("endbox");
+       wprintf("</td></tr></table></div>");
+
        wprintf("</BODY></HTML>\n");
+       wDumpContent(0);
        end_webcit_session();
 }