From 095de21d2211d73d50677a2f3f2ee6da59ead5a2 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 11 Feb 2012 18:39:25 -0500 Subject: [PATCH] I think this restores the previous REST-like behavior of the landing page --- webcit/context_loop.c | 3 ++- webcit/webcit.c | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/webcit/context_loop.c b/webcit/context_loop.c index e9f940195..dc74601e1 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -336,7 +336,8 @@ int ReadHttpSubject(ParsedHttpHdrs *Hdr, StrBuf *Line, StrBuf *Buf) else { /* 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")); + StrBuf *NewLine = NewStrBuf(); + StrBufAppendPrintf(NewLine, "GET /landing?go=%s HTTP/1.0", ChrPtr(Buf)); syslog(LOG_DEBUG, "Replacing with: %s", ChrPtr(NewLine)); int return_value = ReadHttpSubject(Hdr, NewLine, Buf); FreeStrBuf(&NewLine); diff --git a/webcit/webcit.c b/webcit/webcit.c index 94dda267c..bb36f9898 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -821,7 +821,13 @@ void display_default_landing_page(void) { if (WCC && WCC->serv_info && WCC->serv_info->serv_supports_guest) { /* default action */ - if (default_landing_page) { + if (havebstr("go")) { + syslog(9, "Explicit room selection: %s", bstr("go")); + StrBuf *teh_room = NewStrBufPlain(bstr("go"), strlen(bstr("go"))); + smart_goto(teh_room); + FreeStrBuf(&teh_room); + } + else if (default_landing_page) { http_redirect(default_landing_page); } else { -- 2.30.2