Summary page displays site name instead of user name when not logged in
[citadel.git] / webcit / webcit.c
index f49d4ea3da23ac033264943c78b4da15f04f880e..67acf54e8f79942ce2a04341e9498bb1d1e859d4 100644 (file)
@@ -742,7 +742,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
@@ -752,14 +752,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();
                        }
                }
                /*
@@ -779,6 +773,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
  */