]> code.citadel.org Git - citadel.git/commitdiff
* Prepare for a way to avoid falling out of the main frameset
authorArt Cancro <ajc@citadel.org>
Mon, 9 Feb 2004 04:49:32 +0000 (04:49 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 9 Feb 2004 04:49:32 +0000 (04:49 +0000)
webcit/ChangeLog
webcit/context_loop.c
webcit/webcit.c
webcit/webcit.h

index 79365084b917260a74323c0e95376d4efc097567..3069fb6565df2686b8940a9b11acd2146b8b3ae6 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 504.3  2004/02/09 04:49:32  ajc
+* Prepare for a way to avoid falling out of the main frameset
+
 Revision 504.2  2004/02/09 03:37:57  ajc
 * Changed the thread pool management algorithm.  Detecting idle time between
   socket accepts was not working reliably on all systems, so we now follow
@@ -1643,3 +1646,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 1832afb795466b0adc86a7f1ca9017e3c728fee0..7d5abac3cb022f0e03be70b08a7e98477b5fe607 100644 (file)
@@ -262,6 +262,7 @@ void context_loop(int sock)
        int desired_session = 0;
        int got_cookie = 0;
        struct wcsession *TheSession, *sptr;
+       int outside_frameset_allowed = 0;
 
        /*
         * Find out what it is that the web browser is asking for
@@ -314,7 +315,11 @@ void context_loop(int sock)
                                "?force_close_session=yes HTTP/1.0");
        }
 
-       /* Do the non-root-cookie check now. */
+       /* These are the URL's which may be executed without a
+        * session cookie already set.  If it's not one of these,
+        * force the session to close because cookies are
+        * probably disabled on the client browser.
+        */
        else if ( (strcmp(buf, "/"))
                && (strncasecmp(buf, "/listsub", 8))
                && (strncasecmp(buf, "/freebusy", 9))
@@ -323,6 +328,21 @@ void context_loop(int sock)
                                "?force_close_session=yes HTTP/1.0");
        }
 
+       /* These are the URL's which may be executed outside of the
+        * main frameset.  If it's not one of these, the page will
+        * need JavaScript added to force the frameset to reload.
+        */
+       if ( (!strcasecmp(buf, "/"))
+          || (!strcasecmp(buf, "/static/mainframeset.html"))
+          || (!strcasecmp(buf, "/static/robots.txt"))
+          || (!strncasecmp(buf, "/listsub", 8))
+          || (!strncasecmp(buf, "/freebusy", 9))
+          || (!strncasecmp(buf, "/termquit", 9)) ) {
+               outside_frameset_allowed = 1;
+       }
+       else {
+               outside_frameset_allowed = 0;
+       }
 
        /*
         * See if there's an existing session open with the desired ID
@@ -367,7 +387,8 @@ void context_loop(int sock)
        pthread_setspecific(MyConKey, (void *)TheSession);
        TheSession->http_sock = sock;
        TheSession->lastreq = time(NULL);                       /* log */
-       session_loop(req);              /* perform the requested transaction */
+       TheSession->outside_frameset_allowed = outside_frameset_allowed;
+       session_loop(req);                                      /* do transaction */
        pthread_mutex_unlock(&TheSession->SessionMutex);        /* unbind */
 
        /* Free the request buffer */
index 4729b005c4440f38a395ceb96d683f72e676bea6..912301d69652a2da60a96908919006f7de5c4e7d 100644 (file)
@@ -341,6 +341,10 @@ void output_headers(int controlcode)
                );
                /* end script */
 
+               if (!WC->outside_frameset_allowed) {
+                       /* FIXME put this here */
+               }
+
                do_template("head");
                clear_local_substs();
 
index eb08e8b5f77eae6ca16faf50d0bf3de2fd45fc99..e799bc4178a7587e167e5c86e9e5d53a058caefb 100644 (file)
@@ -216,6 +216,8 @@ struct wcsession {
 #endif
        struct wc_attachment *first_attachment;
        char ImportantMessage[SIZ];
+       int outside_frameset_allowed;   /* nonzero if current req is allowed
+                                        * outside of the main frameset */
 };
 
 #define extract(dest,source,parmnum)   extract_token(dest,source,parmnum,'|')