* add a Display name to our handlers; this will be used by DAV handlers.
[citadel.git] / webcit / listsub.c
index 0f2fd8e86a395d7873f97f937befd9b9117a0320..f6ed32f2d6ba4b12c52d48b4e6291a72a03b5f1a 100644 (file)
@@ -23,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();
@@ -61,7 +61,7 @@ void do_listsub(void)
                        email,
                        subtype,
                        (is_https ? "https" : "http"),
-                       WC->http_host
+                           ChrPtr(WC->Hdr->HR.http_host)
                );
                serv_getln(buf, sizeof buf);
                if (buf[0] == '2') {
@@ -99,10 +99,10 @@ void do_listsub(void)
         */
        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->HR.http_host)
                );
                serv_getln(buf, sizeof buf);
                if (buf[0] == '2') {
@@ -224,3 +224,14 @@ FORM:              wprintf("<form method=\"POST\" action=\"listsub\">\n");
        wDumpContent(0);
        end_webcit_session();
 }
+
+
+
+void 
+InitModule_LISTSUB
+(void)
+{
+       WebcitAddUrlHandler(HKEY("listsub"), "", 0, do_listsub, ANONYMOUS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
+
+
+}