]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
Add new member 'PushedDestination' to wcsession. This will be used soon.
[citadel.git] / webcit / webcit.c
index 5a0eec7441eea738b929c802d45a3d70a742e7db..90f5a3d4a96ff4cd769d086552037efb6085e5e6 100644 (file)
@@ -186,7 +186,7 @@ void output_headers(        int do_httpheaders,     /* 1 = output HTTP headers                        */
                        wc_printf("<div id=\"important_message\">\n"
                                "<span class=\"imsg\">");
                        StrEscAppend(WCC->WBuf, NULL, WCC->ImportantMessage, 0, 0);
-                       wc_printf("</span><br />\n"
+                       wc_printf("</span><br>\n"
                                "</div>\n"
                        );
                        StrBufAppendBufPlain(WCC->trailing_javascript,
@@ -199,7 +199,7 @@ void output_headers(        int do_httpheaders,     /* 1 = output HTTP headers                        */
                        wc_printf("<div id=\"important_message\">\n"
                                "<span class=\"imsg\">");
                        StrEscAppend(WCC->WBuf, WCC->ImportantMsg, NULL, 0, 0);
-                       wc_printf("</span><br />\n"
+                       wc_printf("</span><br>\n"
                                "</div>\n"
                        );
                        StrBufAppendBufPlain(WCC->trailing_javascript,
@@ -647,8 +647,7 @@ void session_loop(void)
        }
 
        /*
-        * If we're not connected to a Citadel server, try to hook up the
-        * connection now.
+        * If we're not connected to a Citadel server, try to hook up the connection now.
         */
        if (!WCC->connected) {
                if (GetConnected()) {
@@ -663,9 +662,9 @@ void session_loop(void)
                        wc_printf("</body></html>\n");
                        end_burst();
                        goto SKIP_ALL_THIS_CRAP;
+               }
        }
 
-
        /*
         * If we're not logged in, but we have authentication data (either from
         * a cookie or from http-auth), try logging in to Citadel using that.
@@ -752,7 +751,7 @@ void session_loop(void)
                                end_ajax_response();
                }
        }
-       /* When all else fails, display the main menu. */
+       /* When all else fails, display the default landing page or a main menu. */
        else {
                /* 
                 * ordinary browser users get a nice login screen, DAV etc. requsets
@@ -762,14 +761,8 @@ void session_loop(void)
                        if (xhttp) {
                                authorization_required();
                        }
-                       else if (WCC->serv_info->serv_supports_guest) {
-                               /* default action.  probably revisit this. */
-                               StrBuf *teh_lobby = NewStrBufPlain(HKEY("_BASEROOM_"));
-                               smart_goto(teh_lobby);
-                               FreeStrBuf(&teh_lobby);
-                       }
                        else {
-                               display_login();
+                               display_default_landing_page();
                        }
                }
                /*
@@ -789,6 +782,23 @@ SKIP_ALL_THIS_CRAP:
 }
 
 
+
+/*
+ * Display the appropriate landing page for this site.
+ */
+void display_default_landing_page(void) {
+       if (WC->serv_info->serv_supports_guest) {
+               /* default action.  probably revisit this. */
+               StrBuf *teh_lobby = NewStrBufPlain(HKEY("_BASEROOM_"));
+               smart_goto(teh_lobby);
+               FreeStrBuf(&teh_lobby);
+       }
+       else {
+               display_login();
+       }
+}
+
+
 /*
  * Replacement for sleep() that uses select() in order to avoid SIGALRM
  */
@@ -947,5 +957,6 @@ SessionDestroyModule_WEBCIT
        FreeStrBuf(&sess->WBuf);
        FreeStrBuf(&sess->HBuf);
        FreeStrBuf(&sess->ImportantMsg);
+       FreeStrBuf(&sess->PushedDestination);
 }