]> code.citadel.org Git - citadel.git/blobdiff - webcit/listsub.c
Removed the unused second argument from the do_template() macro
[citadel.git] / webcit / listsub.c
index 4dba177d09983a484ac4144b6d94664980562bfa..0560d524879491dd8a12fc3c4ba377e9348a471a 100644 (file)
@@ -1,7 +1,21 @@
 /*
- * $Id$
- *
  * Web forms for handling mailing list subscribe/unsubscribe requests.
+ *
+ * Copyright (c) 1996-2011 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 #include "webcit.h"
@@ -26,14 +40,14 @@ void do_listsub(void)
        FlushStrBuf(WC->wc_fullname);
        FlushStrBuf(WC->wc_username);
        FlushStrBuf(WC->wc_password);
-       FlushStrBuf(WC->wc_roomname);
+       FlushStrBuf(WC->CurRoom.name);
 
        output_headers(1, 0, 0, 1, 1, 0);
        begin_burst();
 
        wc_printf("<HTML><HEAD>\n"
                "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\" />\n"
-               "<link href=\"static/webcit.css\" rel=\"stylesheet\" type=\"text/css\">\n"
+               "<link href=\"static/styles/webcit.css\" rel=\"stylesheet\" type=\"text/css\">\n"
                "<TITLE>\n"
        );
        wc_printf(_("List subscription"));
@@ -48,20 +62,20 @@ void do_listsub(void)
        wc_printf("<div align=center>");
        wc_printf("<table border=0 width=75%%><tr><td>");
 
-       svput("BOXTITLE", WCS_STRING, _("List subscribe/unsubscribe"));
-       do_template("beginboxx", NULL);
+       do_template("beginbox_1");
+       StrBufAppendBufPlain(WC->WBuf, _("List subscribe/unsubscribe"), -1, 0);
+       do_template("beginbox_2");
        wc_printf("<div align=center><br>");
 
        /*
         * Subscribe command
         */
        if (!strcasecmp(cmd, "subscribe")) {
-               serv_printf("SUBS subscribe|%s|%s|%s|%s://%s/listsub",
+               serv_printf("SUBS subscribe|%s|%s|%s|%s/listsub",
                        room,
                        email,
                        subtype,
-                       (is_https ? "https" : "http"),
-                           ChrPtr(WC->Hdr->HR.http_host)
+                       ChrPtr(site_prefix)
                );
                serv_getln(buf, sizeof buf);
                if (buf[0] == '2') {
@@ -79,16 +93,16 @@ void do_listsub(void)
                                "your subscription.  This extra step is for "
                                "your protection, as it prevents others from "
                                "being able to subscribe you to lists "
-                               "without your consent.<br /><br />"
+                               "without your consent.<br><br>"
                                "Please click on the link which is being "
                                "e-mailed to you and your subscription will "
-                               "be confirmed.<br />\n"),
+                               "be confirmed.<br>\n"),
                                escaped_email, escaped_room);
                        wc_printf("<a href=\"listsub\">%s</A></CENTER>\n", _("Go back..."));
                }
                else {
                        wc_printf("<FONT SIZE=+1><B>ERROR: %s</B>"
-                               "</FONT><br /><br />\n",
+                               "</FONT><br><br>\n",
                                &buf[4]);
                        goto FORM;
                }
@@ -98,11 +112,10 @@ 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"),
-                           ChrPtr(WC->Hdr->HR.http_host)
+               serv_printf("SUBS unsubscribe|%s|%s|%s/listsub",
+                       room,
+                       email,
+                       ChrPtr(site_prefix)
                );
                serv_getln(buf, sizeof buf);
                if (buf[0] == '2') {
@@ -117,16 +130,16 @@ void do_listsub(void)
                                "your unsubscription.  This extra step is for "
                                "your protection, as it prevents others from "
                                "being able to unsubscribe you from "
-                               "lists without your consent.<br /><br />"
+                               "lists without your consent.<br><br>"
                                "Please click on the link which is being "
                                "e-mailed to you and your unsubscription will "
-                               "be confirmed.<br />\n"
+                               "be confirmed.<br>\n"
                                "<a href=\"listsub\">Back...</A></CENTER>\n"
                        );
                }
                else {
                        wc_printf("<FONT SIZE=+1><B>ERROR: %s</B>"
-                               "</FONT><br /><br />\n",
+                               "</FONT><br><br>\n",
                                &buf[4]);
                        goto FORM;
                }
@@ -157,7 +170,7 @@ void do_listsub(void)
                                "The error returned by the server was: "
                        );
                }
-               wc_printf("%s</CENTER><br />\n", &buf[4]);
+               wc_printf("%s</CENTER><br>\n", &buf[4]);
        }
 
        /*
@@ -211,13 +224,13 @@ FORM:             wc_printf("<form method=\"POST\" action=\"listsub\">\n");
                        " one additional web link to click on for final "
                        "confirmation.  This extra step is for your "
                        "protection, as it prevents others from being able to "
-                       "subscribe or unsubscribe you to lists.<br />\n"
+                       "subscribe or unsubscribe you to lists.<br>\n"
                );
 
        }
 
        wc_printf("</div>");
-       do_template("endbox", NULL);
+       do_template("endbox");
        wc_printf("</td></tr></table></div>");
 
        wc_printf("</BODY></HTML>\n");