Summary page displays site name instead of user name when not logged in
authorArt Cancro <ajc@citadel.org>
Tue, 28 Dec 2010 22:55:36 +0000 (17:55 -0500)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 13:31:07 +0000 (13:31 +0000)
webcit/summary.c
webcit/webcit.c
webcit/webcit.h

index b9803a084dd1ab942e58b1083be3effb584c7b84..3ae86f83560f9cac50d1ed57f518b841aa458ca5 100644 (file)
@@ -272,7 +272,9 @@ void summary(void) {
        wc_printf("<table border=0><tr>");
         wc_printf("<td><img src=\"static/summscreen_48x.gif\"></td>");
         wc_printf("<td><h1>");
-        snprintf(title, sizeof title, _("Summary page for %s"), ChrPtr(WC->wc_fullname));
+        snprintf(title, sizeof title, _("Summary page for %s"),
+               ( (WC->logged_in) ?  ChrPtr(WC->wc_fullname) : ChrPtr(WC->serv_info->serv_humannode))
+       );
         escputs(title);
         wc_printf("</h1><h2>");
         output_date();
index 5a0eec7441eea738b929c802d45a3d70a742e7db..b0236838823e0f618e7056a75baa77d1ddebd7a1 100644 (file)
@@ -752,7 +752,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 +762,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 +783,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
  */
index d772b27ade7fe19d76f802796960fa828e02d5a2..59d2dec1a450fa6f3d24c5787a222cef03de6c2a 100644 (file)
@@ -639,6 +639,7 @@ void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_respo
 void openid_manual_create(void);
 void display_login(void);
 void display_openids(void);
+void display_default_landing_page(void);
 void do_welcome(void);
 void do_logout(void);
 void display_main_menu(void);