From 8d935be9b86b19d6a811ef7d44b91d93cad95761 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 15 Apr 1999 00:03:05 +0000 Subject: [PATCH] Got it! --- webcit/auth.c | 14 +++++++------- webcit/child.h | 2 +- webcit/graphics.c | 4 ++-- webcit/mainmenu.c | 8 ++++---- webcit/messages.c | 14 +++++++------- webcit/netconf.c | 20 ++++++++++---------- webcit/paging.c | 6 +++--- webcit/roomops.c | 20 ++++++++++---------- webcit/siteconfig.c | 2 +- webcit/sysmsgs.c | 6 +++--- webcit/userlist.c | 4 ++-- webcit/webcit.c | 17 +++++++---------- webcit/who.c | 6 +++--- 13 files changed, 60 insertions(+), 63 deletions(-) diff --git a/webcit/auth.c b/webcit/auth.c index 184c04cf8..590f891c4 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -36,7 +36,7 @@ void display_login(char *mesg) char buf[256]; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "_top"); + output_headers(1); /* Da banner */ wprintf("
\n"); @@ -89,7 +89,7 @@ void display_login(char *mesg) wprintf("
  • You must use a browser that supports cookies.
    \n"); wprintf("\n"); - wDumpContent(1); + wDumpContent(0); /* No menu here; not logged in yet! */ } @@ -177,7 +177,7 @@ void do_welcome(void) if (noframes) { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "_top"); + output_headers(1); wprintf("

    "); escputs(wc_username); wprintf("

    \n"); @@ -198,7 +198,7 @@ void do_logout(void) strcpy(wc_roomname, ""); printf("HTTP/1.0 200 OK\n"); - output_headers(2, "_top"); /* note "2" causes cookies to be unset */ + output_headers(2); /* note "2" causes cookies to be unset */ wprintf("
    "); serv_puts("MESG goodbye"); @@ -230,7 +230,7 @@ void validate(void) int a; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); strcpy(buf, bstr("user")); if (strlen(buf) > 0) @@ -309,7 +309,7 @@ void display_reg(int during_login) int a; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("
    "); wprintf("
    "); wprintf("Set/change %s\n", description); @@ -94,7 +94,7 @@ void select_floor_to_edit_pic(void) int a; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("
    "); wprintf("
    "); wprintf("Server command results\n"); diff --git a/webcit/messages.c b/webcit/messages.c index 9719518c1..4007bd2e9 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -221,7 +221,7 @@ void readloop(char *oper) int nummsgs; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    %s - ", wc_roomname); if (!strcmp(oper, "readnew")) { @@ -265,7 +265,7 @@ void post_message(void) char buf[256]; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); strcpy(buf, bstr("sc")); if (strcasecmp(buf, "Save message")) { @@ -325,7 +325,7 @@ void display_enter(void) struct tm *tm; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); sprintf(buf, "ENT0 0|%s|0|0", bstr("recp")); serv_puts(buf); @@ -388,7 +388,7 @@ void confirm_delete_msg(void) msgid = atol(bstr("msgid")); printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("
    "); wprintf("
    "); wprintf("Edit share list for "); @@ -68,7 +68,7 @@ void display_netconf(void) char node[256]; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("Network configuration\n"); @@ -112,7 +112,7 @@ void display_confirm_unshare(void) char sroom[256]; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("Confirm unshare\n"); @@ -140,7 +140,7 @@ void display_confirm_delete_node(void) char node[256]; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("Confirm delete\n"); @@ -169,7 +169,7 @@ void delete_node(void) serv_gets(buf); if (buf[0] == '1') { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); server_to_text(); wprintf("Back to menu\n"); wDumpContent(1); @@ -192,7 +192,7 @@ void unshare(void) serv_gets(buf); if (buf[0] == '1') { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); server_to_text(); wprintf("Back to menu\n"); wDumpContent(1); @@ -207,7 +207,7 @@ void display_add_node(void) { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("Add a new node\n"); @@ -243,7 +243,7 @@ void add_node(void) serv_gets(buf); if (buf[0] == '1') { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); server_to_text(); wprintf("Back to menu\n"); wDumpContent(1); @@ -267,7 +267,7 @@ void display_share(void) strcpy(node, bstr("node")); printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("Add a shared room\n"); @@ -347,7 +347,7 @@ void share(void) serv_gets(buf); if (buf[0] == '1') { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); server_to_text(); wprintf("Back to menu\n"); wDumpContent(1); diff --git a/webcit/paging.c b/webcit/paging.c index 5cfbdddb9..3fb54f9a7 100644 --- a/webcit/paging.c +++ b/webcit/paging.c @@ -21,7 +21,7 @@ void display_page(void) char user[256]; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("
    "); wprintf(""); + wprintf("\" TARGET=\"top\">"); escputs1(rmname, 1); if ((f & QR_DIRECTORY) && (f & QR_NETWORK)) wprintf("}"); @@ -237,7 +237,7 @@ void list_all_rooms_by_floor(void) load_floorlist(); printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf(""); wprintf(""); @@ -284,7 +284,7 @@ void list_all_rooms_by_floor(void) void zapped_list(void) { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    FloorRooms with new messages
    "); wprintf("Zapped (forgotten) rooms\n"); @@ -329,7 +329,7 @@ void gotoroom(char *gname, int display_name) if (display_name) { printf("HTTP/1.0 200 OK\n"); - output_headers(0, "top"); + output_headers(0); wprintf("\n
    "); wprintf("
    "); wprintf("
    "); wprintf("
    "); wprintf("
    "); wprintf("Confirm deletion of room\n"); diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index 58848abd5..929840e28 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -26,7 +26,7 @@ void display_siteconfig(void) return; } printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("Site configuration"); diff --git a/webcit/sysmsgs.c b/webcit/sysmsgs.c index 2ba2e43fb..b17abfc42 100644 --- a/webcit/sysmsgs.c +++ b/webcit/sysmsgs.c @@ -24,7 +24,7 @@ void display_edit(char *description, char *check_cmd, return; } printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("\n", description); wDumpContent(1); return; @@ -79,7 +79,7 @@ void save_edit(char *description, char *enter_cmd, int regoto) gotoroom(wc_roomname, 1); } else { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("%s has been saved.\n", description); wDumpContent(1); } diff --git a/webcit/userlist.c b/webcit/userlist.c index 1f6642f92..d710ca5e9 100644 --- a/webcit/userlist.c +++ b/webcit/userlist.c @@ -37,7 +37,7 @@ void userlist(void) bio = bptr; } printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); serv_puts("LIST"); serv_gets(buf); @@ -102,7 +102,7 @@ void showuser(void) int have_pic; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); diff --git a/webcit/webcit.c b/webcit/webcit.c index 63e03dead..3e439f57d 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -327,7 +327,7 @@ char *getz(char *buf) * If print_standard_html_head is nonzero, we also get some standard HTML * headers. If it's set to 2, the session is considered to be closing. */ -void output_headers(int print_standard_html_head, char *target) +void output_headers(int print_standard_html_head) { static char *unset = "; expires=28-May-1971 18:10:00 GMT"; @@ -336,9 +336,6 @@ void output_headers(int print_standard_html_head, char *target) printf("Server: %s\n", SERVER); printf("Connection: close\n"); - /* if ((strlen(target) > 0) && (noframes == 0)) { - printf("Window-target: %s\n", target); - } */ if (print_standard_html_head > 0) { printf("Pragma: no-cache\n"); printf("Cache-Control: no-store\n"); @@ -412,7 +409,7 @@ void output_static(char *what) fp = fopen(buf, "rb"); if (fp == NULL) { printf("HTTP/1.0 404 %s\n", strerror(errno)); - output_headers(0, ""); + output_headers(0); printf("Content-Type: text/plain\n"); sprintf(buf, "%s: %s\n", what, strerror(errno)); printf("Content-length: %d\n", strlen(buf)); @@ -420,7 +417,7 @@ void output_static(char *what) fwrite(buf, strlen(buf), 1, stdout); } else { printf("HTTP/1.0 200 OK\n"); - output_headers(0, ""); + output_headers(0); if (!strncasecmp(&what[strlen(what) - 4], ".gif", 4)) printf("Content-type: image/gif\n"); @@ -457,7 +454,7 @@ void output_image() if (buf[0] == '2') { bytes = extract_long(&buf[4], 0); printf("HTTP/1.0 200 OK\n"); - output_headers(0, ""); + output_headers(0); printf("Content-type: image/gif\n"); printf("Content-length: %ld\n", (long) bytes); printf("\n"); @@ -480,7 +477,7 @@ void output_image() serv_gets(buf); } else { printf("HTTP/1.0 404 %s\n", strerror(errno)); - output_headers(0, ""); + output_headers(0); printf("Content-Type: text/plain\n"); sprintf(buf, "Error retrieving image\n"); printf("Content-length: %d\n", strlen(buf)); @@ -497,7 +494,7 @@ void output_image() void convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext) { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    ", titlebarcolor); wprintf("%s\n", titlebarmsg); @@ -865,7 +862,7 @@ void session_loop(char *browser_host) /* When all else fails... */ else { printf("HTTP/1.0 200 OK\n"); - output_headers(1, ""); + output_headers(1); wprintf("TransactionCount is %d
    \n", TransactionCount); wprintf("You're in session %d
    \n", wc_session); diff --git a/webcit/who.c b/webcit/who.c index 4fb70a56c..62dbe1e72 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -32,7 +32,7 @@ void whobbs(void) int foundit; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("Users currently on "); @@ -151,7 +151,7 @@ void terminate_session(void) } } else { printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); wprintf("
    "); wprintf("Confirm session termination"); wprintf("
    \n"); @@ -184,7 +184,7 @@ void edit_me(void) char buf[256]; printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + output_headers(1); if (!strcasecmp(bstr("sc"), "Change room name")) { serv_printf("RCHG %s", bstr("fake_roomname")); -- 2.30.2