11 #include <sys/socket.h>
14 #include <netinet/in.h>
26 * display the form for paging (x-messaging) another user
28 void display_page(void)
33 wprintf("HTTP/1.0 200 OK\n");
36 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
37 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
38 wprintf("<B>Page another user</B>\n");
39 wprintf("</FONT></TD></TR></TABLE>\n");
41 wprintf("This command sends a near-real-time message to any currently\n");
42 wprintf("logged in user.<BR><BR>\n");
44 wprintf("<FORM METHOD=\"POST\" ACTION=\"/page_user\">\n");
46 wprintf("Select a user to send a message to: <BR>");
48 wprintf("<SELECT NAME=\"recp\" SIZE=10>\n");
52 while (serv_gets(buf), strcmp(buf, "000")) {
53 extract(user, buf, 1);
59 wprintf("</SELECT>\n");
62 wprintf("Enter message text:<BR>");
63 wprintf("<INPUT TYPE=\"text\" NAME=\"msgtext\" MAXLENGTH=80 SIZE=80>\n");
64 wprintf("<BR><BR>\n");
66 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send message\">");
67 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
69 wprintf("</FORM></CENTER>\n");
83 wprintf("HTTP/1.0 200 OK\n");
86 strcpy(recp, bstr("recp"));
87 strcpy(msgtext, bstr("msgtext"));
88 strcpy(sc, bstr("sc"));
90 if (strcmp(sc, "Send message")) {
91 wprintf("<EM>Message was not sent.</EM><BR>\n");
93 serv_printf("SEXP %s|%s", recp, msgtext);
97 wprintf("<EM>Message has been sent to ");
99 wprintf(".</EM><BR>\n");
101 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
115 wprintf("HTTP/1.0 200 OK\n");
118 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
119 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
120 wprintf("<B>Real-time chat</B>\n");
121 wprintf("</FONT></TD></TR></TABLE>\n");
123 wprintf("A chat window should be appearing on your screen ");
124 wprintf("momentarily. When you're ");
125 wprintf("done, type <TT>/quit</TT> to exit. You can also ");
126 wprintf("type <TT>/help</TT> for more commands.\n");
128 wprintf("<applet codebase=\"/static\" ");
129 wprintf("code=\"wcchat\" width=2 height=2>\n");
130 wprintf("<PARAM NAME=username VALUE=\"%s\">\n", WC->wc_username);
131 wprintf("<PARAM NAME=password VALUE=\"%s\">\n", WC->wc_password);
132 wprintf("<H2>Oops!</H2>Looks like your browser doesn't support Java, ");
133 wprintf("so you won't be able to access Chat. Sorry.\n");
134 wprintf("</applet>\n");