among other places, IE 5. Die, Bill, Die.
+Wed Jun 2 23:47:58 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+ * Ditched the frames mode completely. It wasn't working properly in,
+ among other places, IE 5. Die, Bill, Die.
+
Sat May 29 00:25:47 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Fixed the behavior of the "forget room" routine, to properly handle
the transition back to the Lobby after it's all done.
char buf[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(3);
/* Da banner */
wprintf("<CENTER><TABLE border=0 width=100%><TR><TD>\n");
wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"New User\">\n");
wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Exit\">\n");
- /* Only offer the "check to disable frames" selection if frames haven't
- * already been disabled by the browser braindamage check.
- */
- if (noframes == 0) {
- wprintf("<BR><INPUT TYPE=\"checkbox\" NAME=\"noframes\">");
- wprintf("<FONT SIZE=-1> Check here to disable frames</FONT>\n");
- wprintf("</FORM></CENTER>\n");
- }
-
/* Da instructions */
wprintf("<LI><EM>If you already have an account on %s,",
serv_info.serv_humannode);
int need_regi = 0;
- /* Note that the initial value of noframes is set by the browser braindamage
- * check, so don't add an "else" clause here.
- */
- if (!strcasecmp(bstr("noframes"), "on"))
- noframes = 1;
-
if (!strcasecmp(bstr("action"), "Exit")) {
do_logout();
}
void do_welcome(void)
{
-
- if (noframes) {
- smart_goto("_BASEROOM_");
- } else {
- output_static("frameset.html");
- }
+ smart_goto("_BASEROOM_");
}
*
* Given the value of the HTTP "User-agent:" directive supplied by
* a web browser, determine using a local configuration file whether
- * the browser is capable of handling WebCit's frames/JavaScript mode.
+ * the browser is capable of handling JavaScript.
*
* This function returns one of the following values:
- * B_YES (Yes, it's ok to use frames and JavaScript)
- * B_NO (No, fall back to the noframes version)
+ * B_YES (Yes, it's ok to use JavaScript)
+ * B_NO (No, fall back to HTML)
* B_ASK (We don't know; ask the user)
*/
req_gets(sock, buf, hold);
if (!strncasecmp(buf, "Cookie: webcit=", 15)) {
cookie_to_stuff(&buf[15], &desired_session,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL);
got_cookie = 1;
}
else if (!strncasecmp(buf, "Content-length: ", 16)) {
/*
* Pack all session info into one easy-to-digest cookie. Healthy and delicious!
*/
-void stuff_to_cookie(char *cookie, int session, char *user, char *pass, char *room, int nofr)
+void stuff_to_cookie(char *cookie, int session, char *user, char *pass, char *room)
{
char buf[256];
int i;
- sprintf(buf, "%d|%s|%s|%s|%d", session, user, pass, room, nofr);
+ sprintf(buf, "%d|%s|%s|%s", session, user, pass, room);
strcpy(cookie, "");
for (i = 0; i < strlen(buf); ++i)
/*
* Extract all that fun stuff out of the cookie.
*/
-void cookie_to_stuff(char *cookie, int *session, char *user, char *pass, char *room, int *nofr)
+void cookie_to_stuff(char *cookie, int *session, char *user, char *pass, char *room)
{
char buf[256];
int i;
extract(pass, buf, 2);
if (room != NULL)
extract(room, buf, 3);
- if (nofr != NULL)
- *nofr = extract_int(buf, 4);
}
/*
- * Display the menubar. Set as_single_page to 1 if we're inside a frameset
- * and need to display HTML headers and footers -- otherwise it's assumed
+ * Display the menubar. Set as_single_page to
+ * display HTML headers and footers -- otherwise it's assumed
* that the menubar is being embedded in another page.
*/
void display_menubar(int as_single_page) {
FILE *menubar_body;
char buf[256];
- int i;
if (as_single_page) {
printf("HTTP/1.0 200 OK\n");
wprintf("menubar<BR>%s", strerror(errno));
} else {
while (fgets(buf, sizeof(buf), menubar_body) != NULL) {
- /* Sleazy hack to disable TARGET= directive */
- if (noframes) for (i=0; i<strlen(buf); ++i) {
- if (!strncasecmp(&buf[i], "TARGET", 6)) {
- buf[i]='Q';
- }
- }
wprintf("%s", buf);
}
fclose(menubar_body);
wprintf("<A HREF=\"/dotgoto&room=");
urlescputs(rmname);
wprintf("\"");
- if (!noframes) wprintf("TARGET=\"top\"");
wprintf(">");
escputs1(rmname, 1);
if ((f & QR_DIRECTORY) && (f & QR_NETWORK))
output_headers(0);
wprintf("<HTML><HEAD></HEAD>\n<BODY ");
-
- /* automatically fire up a read-new-msgs in the bottom frame */
- if (!noframes)
- wprintf("onload=parent.frames.bottom.location=\"/readnew\" ");
-
wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
}
if (display_name != 2) {
void smart_goto(char *next_room) {
- /* In noframes mode, we goto the room silently, then do a
- * read-new-messages which causes the banner to show up anyway.
- */
- if (noframes) {
- gotoroom(next_room, 0);
- readloop("readnew");
- } else {
- /* In frames mode, we let gotoroom() bring up the banner, which then
- * uses JavaScript to bring up the new-messages display in the
- * bottom frame.
- */
- gotoroom(next_room, 1);
- }
+ gotoroom(next_room, 0);
+ readloop("readnew");
}
wprintf("disappear from your room list. Is this what you wish ");
wprintf("to do?<BR>\n");
- wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\"");
- if (!noframes) wprintf(" TARGET=top");
- wprintf(">\n<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
+ wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
+ wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
wprintf("</FORM>\n");
wDumpContent(1);
<TR>
<TD BGCOLOR="#3333CC">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/knrooms" TARGET="bottom">List known rooms</A>
+ <A HREF="/knrooms">List known rooms</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#3333CC">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/gotonext" TARGET="top">Goto next room</A>
+ <A HREF="/gotonext">Goto next room</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#3333CC">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/skip" TARGET="top">Skip this room</A>
+ <A HREF="/skip">Skip this room</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#3333CC">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/ungoto" TARGET="top">Ungoto</A>
+ <A HREF="/ungoto">Ungoto</A>
</TD>
</TR><TR>
<TD BGCOLOR="#003399">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/readnew" TARGET="bottom">Read new messages</A>
+ <A HREF="/readnew">Read new messages</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#003399">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/readfwd" TARGET="bottom">Read all messages</A>
+ <A HREF="/readfwd">Read all messages</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#003399">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/display_enter" TARGET="bottom">Enter a message</A>
+ <A HREF="/display_enter">Enter a message</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#663399">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/whobbs" TARGET="bottom">Who is online?</A>
+ <A HREF="/whobbs">Who is online?</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#663399">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/userlist" TARGET="bottom">User list</A>
+ <A HREF="/userlist">User list</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#663399">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/advanced" TARGET="bottom">Advanced options</A>
+ <A HREF="/advanced">Advanced options</A>
</FONT>
</TD>
</TR><TR>
<TD BGCOLOR="#CC0000">
<FONT FACE="Arial,Helvetica,sans-serif" SIZE=-1>
- <A HREF="/termquit" TARGET="_top" onClick="return confirm('Do you really want to log off?');">Log off</A><BR>
+ <A HREF="/termquit" onClick="return confirm('Do you really want to log off?');">Log off</A><BR>
</TD>
</TR>
</TABLE>
#include "child.h"
#include "mime_parser.h"
-int fake_frames = 0;
-
int wc_session;
char wc_username[256];
char wc_password[256];
int logged_in = 0;
int axlevel;
char *ExpressMessages = NULL;
-int noframes = 0;
int new_mail = 0;
int need_vali = 0;
+/* This variable is set to 1 if the room banner and menubar have been
+ * displayed, and we need to close the <TABLE> tags.
+ */
+int fake_frames = 0;
+
struct webcontent *wlist = NULL;
struct webcontent *wlast = NULL;
* calculate a Content-length: header.
*
* print_standard_html_footer should be set to 0 to transmit only, 1 to
- * append the main menu (if in noframes mode) and closing tags, or 2 to
+ * append the main menu and closing tags, or 2 to
* append the closing tags only.
*/
void wDumpContent(int print_standard_html_footer)
}
if (print_standard_html_footer) {
- if ((noframes) && (print_standard_html_footer != 2)) {
+ if (print_standard_html_footer != 2) {
wprintf("<BR>");
- /* embed_main_menu(); */ /* not any more */
}
wprintf("</BODY></HTML>\n");
}
/*
* Output all that important stuff that the browser will want to see
*
- * 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.
+ * print_standard_html_head values:
+ * 0 = Nothing. Do not display any leading HTTP or HTML.
+ * 1 = HTTP headers plus the "fake frames" found in most windows.
+ * 2 = HTTP headers required to terminate the session (unset cookies)
+ * 3 = HTTP headers only.
*/
void output_headers(int print_standard_html_head)
{
printf("Pragma: no-cache\n");
printf("Cache-Control: no-store\n");
}
- stuff_to_cookie(cookie, wc_session, wc_username, wc_password,
- wc_roomname, noframes);
+ stuff_to_cookie(cookie, wc_session, wc_username,
+ wc_password, wc_roomname);
if (print_standard_html_head == 2) {
printf("X-WebCit-Session: close\n");
printf("Set-cookie: webcit=%s\n", unset);
wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
- if ((print_standard_html_head == 1) && (noframes == 1)) {
- wprintf("<TABLE border=0 width=100%>");
- wprintf("<TR VALIGN=TOP><TD>");
+ if (print_standard_html_head == 1) {
+ wprintf("<TABLE border=0 width=100%>"
+ "<TR VALIGN=TOP><TD>");
display_menubar(0);
wprintf("</TD></TR><TR VALIGN=TOP><TD>\n");
-
fake_frames = 1;
}
}
wprintf("</FONT></TD></TR></TABLE><BR>\n");
escputs(messagetext);
- if (noframes) {
- wprintf("<HR>\n");
- embed_main_menu();
- }
+ wprintf("<HR>\n");
+ embed_main_menu();
wDumpContent(1);
}
if (!strncasecmp(buf, "Cookie: webcit=", 15)) {
strcpy(cookie, &buf[15]);
cookie_to_stuff(cookie, NULL,
- c_username, c_password, c_roomname,
- &noframes);
+ c_username, c_password, c_roomname);
}
if (!strncasecmp(buf, "Content-length: ", 16)) {
ContentLength = atoi(&buf[16]);
strcpy(browser, argv[5]);
bd = browser_braindamage_check(browser);
- if (bd == B_NO)
- noframes = 1;
- else
- noframes = 0;
while (1) {
session_loop(argv[4], browser);
#define HOUSEKEEPING 60 /* Housekeeping frequency */
-/* Values that can be returned by browser_braindamage_check() */
-#define B_YES 0 /* Ok to use frames and JavaScript */
-#define B_NO 1 /* Do not use frames and JavaScript */
-#define B_ASK 2 /* Ask the user */
-
-
/* Room flags (from Citadel) */
#define QR_PERMANENT 1 /* Room does not purge */
#define QR_INUSE 2 /* Set if in use, clear if avail */
#define QR_MAILBOX 16384 /* Set if this is a private mailbox */
+/* Browser braindamage check values */
+enum {
+ B_NO,
+ B_YES,
+ B_ASK
+};
+
struct webcontent {
struct webcontent *next;
extern int upload_length;
extern char *upload;
extern char floorlist[128][256];
-extern int noframes;
extern int new_mail;
extern int need_vali;
-void stuff_to_cookie(char *, int, char *, char *, char *, int);
-void cookie_to_stuff(char *, int *, char *, char *, char *, int *);
+void stuff_to_cookie(char *, int, char *, char *, char *);
+void cookie_to_stuff(char *, int *, char *, char *, char *);
void locate_host(char *, int);
urlescputs(wlist->roomname);
wprintf("\" onMouseOver=\"window.status='Go to room ");
escputs(wlist->roomname);
- wprintf("'; return true\" TARGET=\"top\">");
+ wprintf("'; return true\">");
escputs(wlist->roomname);
wprintf("</A>");
}
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Log$
+ * Revision 1.2 1999/06/03 03:48:52 ajc
+ * * Ditched the frames mode completely. It wasn't working properly in,
+ * among other places, IE 5. Die, Bill, Die.
+ *
* Revision 1.1 1999/03/07 03:09:55 ajc
* * wildmat.c, braindamage.c: added
*
*
*/
-#ifndef lint
-static char *ident = "$Id$";
-static char *copyright = "Copyright (c) 1989 Mark H. Colburn.\nAll rights reserved.\n";
-#endif /* ! lint */
-
-
/* Includes */
#include <stdlib.h>