* Force reload of frameset if someone tries to escape it. Not perfect
authorArt Cancro <ajc@citadel.org>
Wed, 18 Feb 2004 19:17:51 +0000 (19:17 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 18 Feb 2004 19:17:51 +0000 (19:17 +0000)
  but it mostly works at this poing.

webcit/ChangeLog
webcit/context_loop.c
webcit/paging.c
webcit/webcit.c

index 921bb96839688cb5e89704a2d6f574a7a98b5276..bc211bec2b3b3d6b8c588633116c702e91e8c58c 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 504.5  2004/02/18 19:17:51  ajc
+* Force reload of frameset if someone tries to escape it.  Not perfect
+  but it mostly works at this poing.
+
 Revision 504.4  2004/02/17 03:37:11  ajc
 * Indicate to Citadel that we want Server Generated Invitations when
   calendar events are saved.  (No longer the default in Citadel server.)
@@ -1650,3 +1654,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 7d5abac3cb022f0e03be70b08a7e98477b5fe607..037d3c1a85a6d2bbb3e75b71f378e20baf1efa05 100644 (file)
@@ -335,6 +335,7 @@ void context_loop(int sock)
        if ( (!strcasecmp(buf, "/"))
           || (!strcasecmp(buf, "/static/mainframeset.html"))
           || (!strcasecmp(buf, "/static/robots.txt"))
+          || (!strncasecmp(buf, "/page_popup", 11))
           || (!strncasecmp(buf, "/listsub", 8))
           || (!strncasecmp(buf, "/freebusy", 9))
           || (!strncasecmp(buf, "/termquit", 9)) ) {
index 690aa6db12558230a0d13820467601be4736ed64..aeaf7aab5590565426ba19ff93455c3f5f23973f 100644 (file)
@@ -149,7 +149,7 @@ void page_popup(void)
        char buf[SIZ];
        char pagefrom[SIZ];
 
-       /* suppress express message check, do headers but no fake frames */
+       /* suppress express message check, do headers but no frames */
        output_headers(0x08 | 0x03);
 
        while (serv_puts("GEXP"), serv_gets(buf), buf[0]=='1') {
@@ -157,7 +157,7 @@ void page_popup(void)
                extract(pagefrom, &buf[4], 3);
 
                wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>");
-               wprintf("<SPAN CLASS=\"titlebar\">Express message from ");
+               wprintf("<SPAN CLASS=\"titlebar\">Instant message from ");
                escputs(pagefrom);
                wprintf("</SPAN></TD></TR></TABLE>\n");
                
index 912301d69652a2da60a96908919006f7de5c4e7d..5d14735937e1df6a2a9fabe421b5ae0cab5c77a8 100644 (file)
@@ -288,6 +288,7 @@ void output_headers(int controlcode)
        int suppress_check = 0;
        int cache = 0;
        char httpnow[SIZ];
+       char onload_fcn[SIZ];
        static int pageseq = 0;
        print_standard_html_head        =       controlcode & 0x03;
        refresh30                       =       ((controlcode & 0x04) >> 2);
@@ -329,6 +330,17 @@ void output_headers(int controlcode)
                else svprintf("REFRESHTAG", WCS_STRING,
                        "<META HTTP-EQUIV=\"refresh\" CONTENT=\"500363689;\">\n");
                /* script for checking for pages (not always launched) */
+
+               sprintf(onload_fcn, "function onload_fcn() { \n");
+               if (!WC->outside_frameset_allowed) {
+                       strcat(onload_fcn, "  force_frameset();  \n");
+               }
+               if (!suppress_check) if (WC->HaveExpressMessages) {
+                       strcat(onload_fcn, "  launch_page_popup();  \n");
+                       WC->HaveExpressMessages = 0;
+               }
+               strcat(onload_fcn, "} \n");
+
                svprintf("PAGERSCRIPT", WCS_STRING,
                        "<SCRIPT LANGUAGE=\"JavaScript\">\n"
                        "function launch_page_popup() {\n"
@@ -336,23 +348,24 @@ void output_headers(int controlcode)
                        "'toolbar=no,location=no,copyhistory=no,status=no,"
                        "scrollbars=yes,resizable=no,height=250,width=400');\n"
                        "}\n"
+                       "function force_frameset() { \n"
+                       " if (top.frames.length == 0) { \n"
+                       "  top.location.replace('/static/mainframeset.html'); \n"
+                       " } \n"
+                       "} \n"
+                       "%s\n"
                        "</SCRIPT>\n",
-                       ++pageseq
+                       ++pageseq,
+                       onload_fcn
                );
                /* end script */
 
-               if (!WC->outside_frameset_allowed) {
-                       /* FIXME put this here */
-               }
 
                do_template("head");
                clear_local_substs();
 
-               if (!suppress_check) if (WC->HaveExpressMessages) {
-                       svprintf("extrabodyparms", WCS_STRING, "%s", 
-                               "onload=\"launch_page_popup()\" ");
-                       WC->HaveExpressMessages = 0;
-               }
+               svprintf("extrabodyparms", WCS_STRING, "%s", 
+                       "onload='onload_fcn();' ");
 
                do_template("background");
                clear_local_substs();