+#ifdef WEBCIT_WITH_CALENDAR_SERVICE
+ if (!strcasecmp(action, "freebusy")) {
+ do_freebusy(cmd);
+ goto SKIP_ALL_THIS_CRAP;
+ }
+#endif
+
+ /*
+ * If we're not logged in, but we have HTTP Authentication data,
+ * try logging in to Citadel using that.
+ */
+ if ((!WC->logged_in)
+ && (strlen(c_httpauth_user) > 0)
+ && (strlen(c_httpauth_pass) > 0)) {
+ serv_printf("USER %s", c_httpauth_user);
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '3') {
+ serv_printf("PASS %s", c_httpauth_pass);
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '2') {
+ become_logged_in(c_httpauth_user,
+ c_httpauth_pass, buf);
+ strcpy(WC->httpauth_user, c_httpauth_user);
+ strcpy(WC->httpauth_pass, c_httpauth_pass);
+ }
+ }
+ }
+
+ /*
+ * The GroupDAV stuff relies on HTTP authentication instead of
+ * our session's authentication.
+ */
+ if (!strncasecmp(action, "groupdav", 8)) {
+ groupdav_main(req, ContentType, /* do GroupDAV methods */
+ ContentLength, content+body_start);
+ if (!WC->logged_in) {
+ WC->killthis = 1; /* If not logged in, don't */
+ } /* keep the session active */
+ goto SKIP_ALL_THIS_CRAP;
+ }