- 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");
-
- strcpy(cmd, bstr("cmd"));
- strcpy(room, bstr("room"));
- strcpy(token, bstr("token"));
- 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");
-
- /*
- * Subscribe command
- */
- if (!strcasecmp(cmd, "subscribe")) {
- serv_printf("SUBS subscribe|%s|%s|%s|%s://%s/listsub",
- room,
- email,
- subtype,
- (is_https ? "https" : "http"),
- WC->http_host
+int Conditional_LISTSUB_EXECUTE_SUBSCRIBE(StrBuf *Target, WCTemplputParams *TP)
+{
+ int rc;
+ StrBuf *Line;
+ const char *ImpMsg;
+ const StrBuf *Room, *Email, *SubType;
+
+ Room = sbstr("room");
+ if (Room == NULL)
+ {
+ ImpMsg = _("You need to specify the mailinglist to subscribe to.");
+ AppendImportantMessage(ImpMsg, -1);
+ return 0;
+ }
+ Email = sbstr("email");
+ if (Email == NULL)
+ {
+ ImpMsg = _("You need to specify the email address you'd like to subscribe with.");
+ AppendImportantMessage(ImpMsg, -1);
+ return 0;
+ }
+ SubType = sbstr("subtype");
+
+ Line = NewStrBuf();
+ serv_printf("SUBS subscribe|%s|%s|%s|%s/listsub",
+ ChrPtr(Room),
+ ChrPtr(Email),
+ ChrPtr(SubType),
+ ChrPtr(site_prefix)