/* <div id="content"> either. */
int unset_cookies, /* 1 = session is terminating, so unset the cookies */
- int refresh30, /* 1 = automatically refresh page every 30 seconds */
int suppress_check, /* 1 = suppress check for instant messages */
int cache /* 1 = allow browser to cache this page */
) {
if (do_htmlhead) {
/* wprintf("\n"); */
begin_burst();
-
- if (refresh30) {
- svprintf("REFRESHTAG", WCS_STRING, "%s",
- "<meta http-equiv=\"refresh\" content=\"30\" />\n");
- }
- else {
- svprintf("REFRESHTAG", WCS_STRING, "%s",
- "<meta http-equiv=\"refresh\" content=\"500363689;\" />\n");
- }
-
do_template("head");
}
void http_transmit_thing(char *thing, size_t length, char *content_type,
int is_static) {
- output_headers(0, 0, 0, 0, 0, 0, is_static);
+ output_headers(0, 0, 0, 0, 0, is_static);
wprintf("Content-type: %s\r\n"
"Server: %s\r\n"
bytes = extract_long(&buf[4], 0);
content = malloc(bytes + 2);
extract_token(content_type, &buf[4], 3, '|', sizeof content_type);
- output_headers(0, 0, 0, 0, 0, 0, 0);
+ output_headers(0, 0, 0, 0, 0, 0);
read_server_binary(content, bytes);
serv_puts("CLOS");
serv_getln(buf, sizeof buf);
free(content);
} else {
wprintf("HTTP/1.0 404 %s\n", &buf[4]);
- output_headers(0, 0, 0, 0, 0, 0, 0);
+ output_headers(0, 0, 0, 0, 0, 0);
wprintf("Content-Type: text/plain\r\n");
wprintf("\r\n");
wprintf(_("An error occurred while retrieving this part: %s\n"), &buf[4]);
void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext)
{
wprintf("HTTP/1.0 200 OK\n");
- output_headers(1, 1, 2, 0, 0, 0, 0);
+ output_headers(1, 1, 2, 0, 0, 0);
wprintf("<div id=\"banner\">\n");
wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#%s\"><TR><TD>", titlebarcolor);
wprintf("<SPAN CLASS=\"titlebar\">%s</SPAN>\n", titlebarmsg);
* Display a blank page.
*/
void blank_page(void) {
- output_headers(1, 1, 0, 0, 1, 0, 0);
+ output_headers(1, 1, 0, 0, 0, 0);
wDumpContent(2);
}
set_preference("startpage", bstr("startpage"), 1);
- output_headers(1, 1, 0, 0, 0, 0, 0);
+ output_headers(1, 1, 0, 0, 0, 0);
do_template("newstartpage");
wDumpContent(1);
}
}
+/*
+ * Convenience functions to wrap around asynchronous ajax responses
+ */
+void begin_ajax_response(void) {
+ output_headers(0, 0, 0, 0, 0, 0);
+
+ wprintf("Content-type: text/html; charset=UTF-8\r\n"
+ "Server: %s\r\n"
+ "Connection: close\r\n"
+ "Pragma: no-cache\r\n"
+ "Cache-Control: no-cache\r\n",
+ SERVER);
+ begin_burst();
+}
+
+void end_ajax_response(void) {
+ wprintf("\r\n");
+ wDumpContent(0);
+}
} else if (!strcasecmp(action, "who")) {
who();
} else if (!strcasecmp(action, "who_inner_html")) {
- who_inner_html();
+ begin_ajax_response();
+ who_inner_div();
+ end_ajax_response();
} else if (!strcasecmp(action, "knrooms")) {
knrooms();
} else if (!strcasecmp(action, "gotonext")) {
#endif
} else if (!strcasecmp(action, "summary")) {
summary();
+ } else if (!strcasecmp(action, "summary_inner_div")) {
+ begin_ajax_response();
+ summary_inner_div();
+ end_ajax_response();
} else if (!strcasecmp(action, "iconbar")) {
do_iconbar();
} else if (!strcasecmp(action, "display_customize_iconbar")) {
} else if (!strcasecmp(action, "bcc_autocomplete")) {
recp_autocomplete(bstr("bcc"));
} else if (!strcasecmp(action, "diagnostics")) {
- output_headers(1, 1, 1, 0, 0, 0, 0);
+ output_headers(1, 1, 1, 0, 0, 0);
wprintf("Session: %d<hr />\n", WC->wc_session);
wprintf("Command: <br /><PRE>\n");
escputs(cmd);