]> code.citadel.org Git - citadel.git/blobdiff - webcit/auth.c
* ParsePref() was returning if it encountered a blank line in the preferences data...
[citadel.git] / webcit / auth.c
index 22dbcfbf29911dba2adc680d3c004189487f6a80..2f023a5ecb31a7464b25d60bd29e21139d178fab 100644 (file)
@@ -173,8 +173,6 @@ void do_login(void)
        wcsession *WCC = WC;
        StrBuf *Buf;
 
-       lprintf(9, "SELECTED LANGUAGE: '%s'\n", bstr("language"));
-
        if (havebstr("language")) {
                set_selected_language(bstr("language"));
                go_selected_language();
@@ -508,14 +506,16 @@ void do_welcome(void)
         */
        if (!get_preference("startpage", &Buf)) {
                Buf = NewStrBuf ();
-               StrBufPrintf(Buf, "dotskip&room=_BASEROOM_");
+               StrBufPrintf(Buf, "dotskip?room=_BASEROOM_");
                set_preference("startpage", Buf, 1);
        }
        if (ChrPtr(Buf)[0] == '/') {
                StrBufCutLeft(Buf, 1);
        }
-       if (StrLength(Buf) == 0)
+       if (StrLength(Buf) == 0) {
                StrBufAppendBufPlain(Buf, "dotgoto?room=_BASEROOM_", -1, 0);
+       }
+       lprintf(9, "Redirecting to user's start page: %s\n", ChrPtr(Buf));
        http_redirect(ChrPtr(Buf));
 }
 
@@ -964,14 +964,6 @@ void Header_HandleCookie(StrBuf *Line, ParsedHttpHdrs *hdr)
        StrBufCutLeft(hdr->HR.RawCookie, (pch - ChrPtr(hdr->HR.RawCookie)) + 7);
        StrBufDecodeHex(hdr->HR.RawCookie);
 
-       if (hdr->c_username == NULL)
-               hdr->c_username = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_USER));
-       if (hdr->c_password == NULL)
-               hdr->c_password = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_PASS));
-       if (hdr->c_roomname == NULL)
-               hdr->c_roomname = NewStrBuf();
-       if (hdr->c_language == NULL)
-               hdr->c_language = NewStrBuf();
        cookie_to_stuff(Line, &hdr->HR.desired_session,
                        hdr->c_username,
                        hdr->c_password,
@@ -981,6 +973,25 @@ void Header_HandleCookie(StrBuf *Line, ParsedHttpHdrs *hdr)
        hdr->HR.got_auth = AUTH_COOKIE;
 }
 
+void 
+HttpNewModule_AUTH
+(ParsedHttpHdrs *httpreq)
+{
+       httpreq->c_username = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_USER));
+       httpreq->c_password = NewStrBufPlain(HKEY(DEFAULT_HTTPAUTH_PASS));
+       httpreq->c_roomname = NewStrBuf();
+       httpreq->c_language = NewStrBuf();
+}
+void 
+HttpDetachModule_AUTH
+(ParsedHttpHdrs *httpreq)
+{
+       FLUSHStrBuf(httpreq->c_username);
+       FLUSHStrBuf(httpreq->c_password);
+       FLUSHStrBuf(httpreq->c_roomname);
+       FLUSHStrBuf(httpreq->c_language);
+}
+
 void 
 HttpDestroyModule_AUTH
 (ParsedHttpHdrs *httpreq)