$Log$
+Revision 500.4 2003/06/26 03:37:58 ajc
+* Allow anonymous HTTP requests for /freebusy/user%20name.vcf (or .vfb)
+ This will allow some groupware clients to browse the free/busy times of
+ other users on the system.
+
Revision 500.3 2003/06/21 05:17:21 ajc
* Better alignment of system messages
* Exterminated display_error() and replaced it with WC->ImportantMessage
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
-
}
}
+
+
+
+
+/*
+ * freebusy display (for client software)
+ */
+void do_freebusy(char *req) {
+ char who[SIZ];
+ char buf[SIZ];
+ char *fb;
+
+ extract_token(who, req, 1, ' ');
+ if (!strncasecmp(who, "/freebusy/", 10)) {
+ strcpy(who, &who[10]);
+ }
+ unescape_input(who);
+
+ if ( (!strcasecmp(&who[strlen(who)-4], ".vcf"))
+ || (!strcasecmp(&who[strlen(who)-4], ".vcf")) ) {
+ who[strlen(who)-4] = 0;
+ }
+
+ lprintf(9, "freebusy requested for <%s>\n", who);
+ serv_printf("ICAL freebusy|%s", who);
+ serv_gets(buf);
+
+ if (buf[0] != '1') {
+ wprintf("HTTP/1.0 404 %s\n", &buf[4]);
+ output_headers(0);
+ wprintf("Content-Type: text/plain\n");
+ wprintf("\n");
+ wprintf("%s\n", &buf[4]);
+ return;
+ }
+
+ fb = read_server_text();
+ http_transmit_thing(fb, strlen(fb), "text/calendar");
+ free(fb);
+}
+
+
+
#endif /* WEBCIT_WITH_CALENDAR_SERVICE */
/* Do the non-root-cookie check now. */
else if ( (strcmp(buf, "/"))
&& (strncasecmp(buf, "/listsub", 8))
+ && (strncasecmp(buf, "/freebusy", 9))
&& (got_cookie == 0)) {
strcpy(req->line, "GET /static/nocookies.html"
"?force_close_session=yes HTTP/1.0");
do_listsub();
goto SKIP_ALL_THIS_CRAP;
}
+#ifdef WEBCIT_WITH_CALENDAR_SERVICE
+ if (!strcasecmp(action, "freebusy")) {
+ do_freebusy(cmd);
+ goto SKIP_ALL_THIS_CRAP;
+ }
+#endif
check_for_express_messages();
int goto_config_room(void);
long locate_user_vcard(char *username, long usernum);
void sleeeeeeeeeep(int);
+void http_transmit_thing(char *thing, size_t length, char *content_type);
+void unescape_input(char *buf);