* form stuff
[citadel.git] / webcit / listsub.c
1 #include <ctype.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4 #include <stdio.h>
5 #include <fcntl.h>
6 #include <signal.h>
7 #include <sys/types.h>
8 #include <sys/wait.h>
9 #include <sys/socket.h>
10 #include <sys/time.h>
11 #include <limits.h>
12 #include <netinet/in.h>
13 #include <netdb.h>
14 #include <string.h>
15 #include <pwd.h>
16 #include <errno.h>
17 #include <stdarg.h>
18 #include <pthread.h>
19 #include <signal.h>
20 #include "webcit.h"
21
22
23
24 /*
25  * List subscription handling
26  */
27 void do_listsub(void)
28 {
29         char cmd[SIZ];
30         char room[SIZ];
31         char token[SIZ];
32         char email[SIZ];
33         char subtype[SIZ];
34
35         strcpy(WC->wc_username, "");
36         strcpy(WC->wc_password, "");
37         strcpy(WC->wc_roomname, "");
38
39         output_headers(2);      /* note "2" causes cookies to be unset */
40
41         strcpy(cmd, bstr("cmd"));
42         strcpy(room, bstr("room"));
43         strcpy(token, bstr("token"));
44         strcpy(email, bstr("email"));
45         strcpy(subtype, bstr("subtype"));
46
47         /*
48          * Subscribe command
49          */
50         if (!strcasecmp(cmd, "xx")) {
51         }
52         
53         /*
54          * Any other (invalid) command causes the form to be displayed
55          */
56         else {
57                 wprintf("<CENTER>"
58                         "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>"
59                         "<FONT SIZE=+1 COLOR=\"FFFFFF\""
60                         "<B>List subscribe/unsubscribe</B>\n"
61                         "</TD></TR></TABLE><BR>\n"
62                 );
63
64                 wprintf("<TABLE BORDER=0>\n"
65                         "<FORM METHOD=\"POST\" ACTION=\"/listsub\">\n"
66                 );
67
68                 wprintf("<TR><TD>Name of list</TD>"
69                         "<TD>xx</TD></TR>\n"
70                 );
71
72                 wprintf("</TABLE>"
73                         "<INPUT TYPE=\"submit\" NAME=\"sc\""
74                         " VALUE=\"Submit\">\n"
75                         "</CENTER></FORM>\n"
76                 );
77         }
78
79         /*
80          * Since this isn't part of a normal Citadel session, we bail right
81          * out without maintaining any state.
82          */
83         wDumpContent(2);
84         end_webcit_session();
85 }