When the root page is requested, replace it with a request for '/landing' which calls...
authorArt Cancro <ajc@uncensored.citadel.org>
Thu, 9 Feb 2012 20:13:58 +0000 (15:13 -0500)
committerArt Cancro <ajc@uncensored.citadel.org>
Thu, 9 Feb 2012 20:13:58 +0000 (15:13 -0500)
webcit/context_loop.c
webcit/webcit.c

index bcab1154cce277f7f441e5196b9c9b8624878bf4..e9f9401952310010b02c0f65615d4cd5fc83c4dd 100644 (file)
@@ -334,10 +334,9 @@ int ReadHttpSubject(ParsedHttpHdrs *Hdr, StrBuf *Line, StrBuf *Buf)
                );
        }
        else {
-               Hdr->HR.DontNeedAuth = 1; /* Flat request? show him the login screen... */
-               StrBuf *NewLine = NewStrBufPlain(HKEY("GET /do_template?template=login"));
-               StrBufUrlescAppend(NewLine, Buf, NULL);
-               StrBufAppendBufPlain(NewLine, HKEY(" HTTP/1.0"), 0);
+               /* If this is a "flat" request for the root, display the configured landing page. */
+               Hdr->HR.DontNeedAuth = 1;
+               StrBuf *NewLine = NewStrBufPlain(HKEY("GET /landing HTTP/1.0"));
                syslog(LOG_DEBUG, "Replacing with: %s", ChrPtr(NewLine));
                int return_value = ReadHttpSubject(Hdr, NewLine, Buf);
                FreeStrBuf(&NewLine);
index 5642ee168a3d8bfa2d1860e7b5aeb6abbefaa230..94dda267c0ea78c2106726050f2099c09a7d72e1 100644 (file)
@@ -914,6 +914,7 @@ InitModule_WEBCIT
 {
        char dir[SIZ];
        WebcitAddUrlHandler(HKEY("blank"), "", 0, blank_page, ANONYMOUS|COOKIEUNNEEDED|ISSTATIC);
+       WebcitAddUrlHandler(HKEY("landing"), "", 0, display_default_landing_page, ANONYMOUS|COOKIEUNNEEDED);
        WebcitAddUrlHandler(HKEY("do_template"), "", 0, url_do_template, ANONYMOUS);
        WebcitAddUrlHandler(HKEY("sslg"), "", 0, seconds_since_last_gexp, AJAX|LOGCHATTY);
        WebcitAddUrlHandler(HKEY("ajax_servcmd"), "", 0, ajax_servcmd, 0);