]> code.citadel.org Git - citadel.git/blobdiff - webcit/auth.c
* start moving the hdr struct up, and add detach callback. Unfinished.
[citadel.git] / webcit / auth.c
index a751b89d8137e778860537a9422a3020d01e19c3..57f9b39a64a530dda010534f6f45f193a09f8645 100644 (file)
@@ -882,21 +882,25 @@ void changepw(void)
 
 int ConditionalAide(StrBuf *Target, WCTemplputParams *TP)
 {
-       return (WC->is_aide == 0);
+       wcsession *WCC = WC;
+       return (WCC != NULL)? (WC->is_aide == 0) : 0;
 }
 
 int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
 {
-       return (WC->is_room_aide == 0);
+       wcsession *WCC = WC;
+       return (WCC != NULL)? (WCC->is_room_aide == 0) : 0;
 }
 
-int ConditionalIsLoggedIn(StrBuf *Target, WCTemplputParams *TP) {
-  return (WC->logged_in == 0);
+int ConditionalIsLoggedIn(StrBuf *Target, WCTemplputParams *TP) 
+{
+       wcsession *WCC = WC;
+       return (WCC != NULL)? (WCC->logged_in == 0) : 0;
 }
 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
-       return ( (WCC->is_room_aide) || (WCC->is_mailbox) || (WCC->room_flags2 & QR2_COLLABDEL) );
+       return (WCC != NULL)? ( (WCC->is_room_aide) || (WCC->is_mailbox) || (WCC->room_flags2 & QR2_COLLABDEL) ) : 0;
 }
 
 
@@ -977,6 +981,16 @@ void Header_HandleCookie(StrBuf *Line, ParsedHttpHdrs *hdr)
        hdr->HR.got_auth = AUTH_COOKIE;
 }
 
+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)