5 * \defgroup calav Functions which handle calendar objects and their processing/display.
11 #include "webserver.h"
13 #ifndef WEBCIT_WITH_CALENDAR_SERVICE
16 * \brief get around non existing types
17 * Handler stubs for builds with no calendar library available
18 * \param part_source dummy pointer to the source
19 * \param msgnum number of the mesage in the db
20 * \param cal_partnum number of the calendar part
22 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
24 wprintf(_("<I>This message contains calendaring/scheduling information,"
25 " but support for calendars is not available on this "
26 "particular system. Please ask your system administrator to "
27 "install a new version of the Citadel web service with "
28 "calendaring enabled.</I><br />\n")
34 * \brief say we can't display calendar items
35 * \param msgnum number of the mesage in our db
37 void display_calendar(long msgnum) {
39 "Cannot display calendar item. You are seeing this error "
40 "because your WebCit service has not been installed with "
41 "calendar support. Please contact your system administrator."
46 * \brief say we can't display task items
47 * \param msgnum number of the mesage in our db
49 void display_task(long msgnum) {
51 "Cannot display to-do item. You are seeing this error "
52 "because your WebCit service has not been installed with "
53 "calendar support. Please contact your system administrator."
56 /** ok, we have calendaring available */
57 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
60 /****** End of handler stubs. Everything below this line is real. ******/
66 * \brief Process a calendar object
67 * ...at this point it's already been deserialized by cal_process_attachment()
68 * \param cal the calendar object
69 * \param recursion_level call stack depth ??????
70 * \param msgnum number of the mesage in our db
71 * \param cal_partnum of the calendar object ????
73 void cal_process_object(icalcomponent *cal,
79 icalproperty *method = NULL;
80 icalproperty_method the_method = ICAL_METHOD_NONE;
82 struct icaltimetype t;
85 char conflict_name[256];
86 char conflict_message[256];
89 static int divcount = 0;
91 sprintf(divname, "rsvp%04x", ++divcount);
93 /** Leading HTML for the display of this object */
94 if (recursion_level == 0) {
95 wprintf("<div class=\"mimepart\">\n");
98 /** Look for a method */
99 method = icalcomponent_get_first_property(cal, ICAL_METHOD_PROPERTY);
101 /** See what we need to do with this */
102 if (method != NULL) {
103 the_method = icalproperty_get_method(method);
106 wprintf("<h2><span>");
108 case ICAL_METHOD_REQUEST:
109 title = _("Meeting invitation");
111 case ICAL_METHOD_REPLY:
112 title = _("Attendee's reply to your invitation");
114 case ICAL_METHOD_PUBLISH:
115 title = _("Published event");
118 title = _("This is an unknown type of calendar item.");
123 wprintf("<div id=\"%s_title\">", divname);
124 wprintf("<img src=\"static/calarea_48x.gif\">"
132 p = icalcomponent_get_first_property(cal, ICAL_SUMMARY_PROPERTY);
135 wprintf(_("Summary:"));
136 wprintf("</dt><dd>");
137 escputs((char *)icalproperty_get_comment(p));
141 p = icalcomponent_get_first_property(cal, ICAL_LOCATION_PROPERTY);
144 wprintf(_("Location:"));
145 wprintf("</dt><dd>");
146 escputs((char *)icalproperty_get_comment(p));
151 * Only show start/end times if we're actually looking at the VEVENT
152 * component. Otherwise it shows bogus dates for things like timezone.
154 if (icalcomponent_isa(cal) == ICAL_VEVENT_COMPONENT) {
156 p = icalcomponent_get_first_property(cal,
157 ICAL_DTSTART_PROPERTY);
159 t = icalproperty_get_dtstart(p);
164 memset(&d_tm, 0, sizeof d_tm);
165 d_tm.tm_year = t.year - 1900;
166 d_tm.tm_mon = t.month - 1;
167 d_tm.tm_mday = t.day;
168 wc_strftime(d_str, sizeof d_str, "%x", &d_tm);
171 wprintf("</dt><dd>%s</dd>", d_str);
174 tt = icaltime_as_timet(t);
175 fmt_date(buf, tt, 0);
177 wprintf(_("Starting date/time:"));
178 wprintf("</dt><dd>%s</dd>", buf);
182 p = icalcomponent_get_first_property(cal, ICAL_DTEND_PROPERTY);
184 t = icalproperty_get_dtend(p);
185 tt = icaltime_as_timet(t);
186 fmt_date(buf, tt, 0);
188 wprintf(_("Ending date/time:"));
189 wprintf("</dt><dd>%s</dd>", buf);
194 p = icalcomponent_get_first_property(cal, ICAL_DESCRIPTION_PROPERTY);
197 wprintf(_("Description:"));
198 wprintf("</dt><dd>");
199 escputs((char *)icalproperty_get_comment(p));
203 /** If the component has attendees, iterate through them. */
204 for (p = icalcomponent_get_first_property(cal, ICAL_ATTENDEE_PROPERTY); (p != NULL); p = icalcomponent_get_next_property(cal, ICAL_ATTENDEE_PROPERTY)) {
206 wprintf(_("Attendee:"));
207 wprintf("</dt><dd>");
208 safestrncpy(buf, icalproperty_get_attendee(p), sizeof buf);
209 if (!strncasecmp(buf, "MAILTO:", 7)) {
211 /** screen name or email address */
212 strcpy(buf, &buf[7]);
217 /** participant status */
218 partstat_as_string(buf, p);
224 /** If the component has subcomponents, recurse through them. */
225 for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
227 c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)) {
228 /* Recursively process subcomponent */
229 cal_process_object(c, recursion_level+1, msgnum, cal_partnum);
232 /** If this is a REQUEST, display conflicts and buttons */
233 if (the_method == ICAL_METHOD_REQUEST) {
235 /* Check for conflicts */
236 lprintf(9, "Checking server calendar for conflicts...\n");
237 serv_printf("ICAL conflicts|%ld|%s|", msgnum, cal_partnum);
238 serv_getln(buf, sizeof buf);
240 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
241 extract_token(conflict_name, buf, 3, '|', sizeof conflict_name);
242 is_update = extract_int(buf, 4);
245 snprintf(conflict_message, sizeof conflict_message,
246 _("This is an update of '%s' which is already in your calendar."), conflict_name);
249 snprintf(conflict_message, sizeof conflict_message,
250 _("This event would conflict with '%s' which is already in your calendar."), conflict_name);
259 escputs(conflict_message);
263 lprintf(9, "...done.\n");
267 /** Display the Accept/Decline buttons */
268 wprintf("<div id=\"%s_question\">"
270 "<a href=\"javascript:RespondToInvitation('%s_question','%s_title','%ld','%s','Accept');\">%s</a>"
272 "<a href=\"javascript:RespondToInvitation('%s_question','%s_title','%ld','%s','Tentative');\">%s</a>"
274 "<a href=\"javascript:RespondToInvitation('%s_question','%s_title','%ld','%s','Decline');\">%s</a>"
277 _("How would you like to respond to this invitation?"),
278 divname, divname, msgnum, cal_partnum, _("Accept"),
279 divname, divname, msgnum, cal_partnum, _("Tentative"),
280 divname, divname, msgnum, cal_partnum, _("Decline")
285 /** If this is a REPLY, display update button */
286 if (the_method == ICAL_METHOD_REPLY) {
288 /** \todo In the future, if we want to validate this object before \
289 * continuing, we can do it this way:
290 serv_printf("ICAL whatever|%ld|%s|", msgnum, cal_partnum);
291 serv_getln(buf, sizeof buf);
295 /** Display the update buttons */
296 wprintf("<div id=\"%s_question\">"
298 "<a href=\"javascript:HandleRSVP('%s_question','%s_title','%ld','%s','Update');\">%s</a>"
300 "<a href=\"javascript:HandleRSVP('%s_question','%s_title','%ld','%s','Ignore');\">%s</a>"
303 _("Click <i>Update</i> to accept this reply and update your calendar."),
304 divname, divname, msgnum, cal_partnum, _("Update"),
305 divname, divname, msgnum, cal_partnum, _("Ignore")
310 /** Trailing HTML for the display of this object */
311 if (recursion_level == 0) {
318 * \brief process calendar mail atachment
319 * Deserialize a calendar object in a message so it can be processed.
320 * (This is the main entry point for these things)
321 * \param part_source the part of the message we want to parse
322 * \param msgnum number of the mesage in our db
323 * \param cal_partnum the number of the calendar item
325 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
328 cal = icalcomponent_new_from_string(part_source);
331 wprintf(_("There was an error parsing this calendar item."));
337 cal_process_object(cal, 0, msgnum, cal_partnum);
339 /* Free the memory we obtained from libical's constructor */
340 icalcomponent_free(cal);
347 * \brief accept/decline meeting
348 * Respond to a meeting request
350 void respond_to_request(void) {
353 begin_ajax_response();
355 serv_printf("ICAL respond|%s|%s|%s|",
360 serv_getln(buf, sizeof buf);
363 wprintf("<table border=0 cellpadding=0><tr><td>");
364 wprintf("<td><img align=\"center\" src=\"static/calarea_48x.gif\"></td><td><b><i>");
365 if (!strcasecmp(bstr("sc"), "accept")) {
366 wprintf(_("You have accepted this meeting invitation. "
367 "It has been entered into your calendar.")
369 } else if (!strcasecmp(bstr("sc"), "tentative")) {
370 wprintf(_("You have tentatively accepted this meeting invitation. "
371 "It has been 'pencilled in' to your calendar.")
373 } else if (!strcasecmp(bstr("sc"), "decline")) {
374 wprintf(_("You have declined this meeting invitation. "
375 "It has <b>not</b> been entered into your calendar.")
379 wprintf(_("A reply has been sent to the meeting organizer."));
380 wprintf("</i></b></td></tr></table>");
382 wprintf("<img align=\"center\" src=\"static/error.gif\"> <b><i>");
383 wprintf("%s\n", &buf[4]);
392 * \brief Handle an incoming RSVP
394 void handle_rsvp(void) {
397 begin_ajax_response();
399 serv_printf("ICAL handle_rsvp|%s|%s|%s|",
404 serv_getln(buf, sizeof buf);
407 wprintf("<table border=0 cellpadding=0><tr><td>");
408 wprintf("<td><img align=\"center\" src=\"static/calarea_48x.gif\"></td><td><b><i>");
409 if (!strcasecmp(bstr("sc"), "update")) {
410 wprintf(_("Your calendar has been updated to reflect this RSVP."));
411 } else if (!strcasecmp(bstr("sc"), "ignore")) {
412 wprintf(_("You have chosen to ignore this RSVP. "
413 "Your calendar has <b>not</b> been updated.")
416 wprintf("</i></b></td></tr></table>");
418 wprintf("<img src=\"static/error.gif\" align=center> %s\n", &buf[4]);
428 /*-----------------------------------------------------------------------**/
433 * \defgroup MsgDisplayHandlers Display handlers for message reading
434 * \ingroup Calendaring
442 * \brief get items, keep them.
443 * If we're reading calendar items, just store them for now. We have to
444 * sort and re-output them later when we draw the calendar.
445 * \param cal Our calendar to process
446 * \param msgnum number of the mesage in our db
448 void display_individual_cal(icalcomponent *cal, long msgnum) {
452 WC->disp_cal = realloc(WC->disp_cal,
453 (sizeof(struct disp_cal) * WC->num_cal) );
454 WC->disp_cal[WC->num_cal - 1].cal = icalcomponent_new_clone(cal);
456 WC->disp_cal[WC->num_cal - 1].cal_msgnum = msgnum;
463 * Display a task by itself (for editing)
464 * \param supplied_vtodo the todo item we want to edit
465 * \param msgnum number of the mesage in our db
467 void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
468 icalcomponent *vtodo;
470 struct icaltimetype t;
472 int created_new_vtodo = 0;
476 if (supplied_vtodo != NULL) {
477 vtodo = supplied_vtodo;
480 * If we're looking at a fully encapsulated VCALENDAR
481 * rather than a VTODO component, attempt to use the first
482 * relevant VTODO subcomponent. If there is none, the
483 * NULL returned by icalcomponent_get_first_component() will
484 * tell the next iteration of this function to create a
487 if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
488 display_edit_individual_task(
489 icalcomponent_get_first_component(
490 vtodo, ICAL_VTODO_COMPONENT
497 vtodo = icalcomponent_new(ICAL_VTODO_COMPONENT);
498 created_new_vtodo = 1;
501 output_headers(1, 1, 2, 0, 0, 0);
502 wprintf("<div id=\"banner\">\n"
503 "<TABLE class=\"calendar_banner\"><TR>"
504 "<TD><img src=\"static/taskmanag_48x.gif\"></TD>"
505 "<td><SPAN CLASS=\"titlebar\">");
506 wprintf(_("Edit task"));
508 "</TD></TR></TABLE>\n"
509 "</div>\n<div id=\"content\">\n"
512 wprintf("<div class=\"fix_scrollbar_bug\">"
513 "<table class=\"calendar_background\"><tr><td>");
515 wprintf("<FORM METHOD=\"POST\" action=\"save_task\">\n");
516 wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
517 wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgnum\" VALUE=\"%ld\">\n",
520 wprintf("<TABLE border=0>\n");
523 wprintf(_("Summary:"));
525 "<INPUT TYPE=\"text\" NAME=\"summary\" "
526 "MAXLENGTH=\"64\" SIZE=\"64\" VALUE=\"");
527 p = icalcomponent_get_first_property(vtodo, ICAL_SUMMARY_PROPERTY);
529 escputs((char *)icalproperty_get_comment(p));
531 wprintf("\"></TD></TR>\n");
534 wprintf(_("Start date:"));
535 wprintf("</TD><TD>");
536 p = icalcomponent_get_first_property(vtodo, ICAL_DTSTART_PROPERTY);
538 t = icalproperty_get_dtstart(p);
541 t = icaltime_from_timet(now, 0);
543 display_icaltimetype_as_webform(&t, "dtstart");
544 wprintf("</TD></TR>\n");
547 wprintf(_("Due date:"));
548 wprintf("</TD><TD>");
549 p = icalcomponent_get_first_property(vtodo, ICAL_DUE_PROPERTY);
551 t = icalproperty_get_due(p);
554 t = icaltime_from_timet(now, 0);
556 display_icaltimetype_as_webform(&t, "due");
557 wprintf("</TD></TR>\n");
559 wprintf(_("Description:"));
560 wprintf("</TD><TD>");
561 wprintf("<TEXTAREA NAME=\"description\" wrap=soft "
562 "ROWS=10 COLS=80 WIDTH=80>\n"
564 p = icalcomponent_get_first_property(vtodo, ICAL_DESCRIPTION_PROPERTY);
566 escputs((char *)icalproperty_get_comment(p));
568 wprintf("</TEXTAREA></TD></TR></TABLE>\n");
571 "<INPUT TYPE=\"submit\" NAME=\"save_button\" VALUE=\"%s\">"
573 "<INPUT TYPE=\"submit\" NAME=\"delete_button\" VALUE=\"%s\">\n"
575 "<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">\n"
582 wprintf("</FORM>\n");
584 wprintf("</td></tr></table></div>\n");
587 if (created_new_vtodo) {
588 icalcomponent_free(vtodo);
593 * \brief Save an edited task
594 * \param supplied_vtodo the task to save
595 * \param msgnum number of the mesage in our db
597 void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
599 int delete_existing = 0;
601 icalcomponent *vtodo, *encaps;
602 int created_new_vtodo = 0;
605 struct icaltimetype t;
607 if (supplied_vtodo != NULL) {
608 vtodo = supplied_vtodo;
610 * If we're looking at a fully encapsulated VCALENDAR
611 * rather than a VTODO component, attempt to use the first
612 * relevant VTODO subcomponent. If there is none, the
613 * NULL returned by icalcomponent_get_first_component() will
614 * tell the next iteration of this function to create a
617 if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
618 save_individual_task(
619 icalcomponent_get_first_component(
620 vtodo, ICAL_VTODO_COMPONENT
627 vtodo = icalcomponent_new(ICAL_VTODO_COMPONENT);
628 created_new_vtodo = 1;
631 if (!IsEmptyStr(bstr("save_button"))) {
633 /** Replace values in the component with ones from the form */
635 while (prop = icalcomponent_get_first_property(vtodo,
636 ICAL_SUMMARY_PROPERTY), prop != NULL) {
637 icalcomponent_remove_property(vtodo, prop);
638 icalproperty_free(prop);
640 icalcomponent_add_property(vtodo,
641 icalproperty_new_summary(bstr("summary")));
643 while (prop = icalcomponent_get_first_property(vtodo,
644 ICAL_DESCRIPTION_PROPERTY), prop != NULL) {
645 icalcomponent_remove_property(vtodo, prop);
646 icalproperty_free(prop);
648 icalcomponent_add_property(vtodo,
649 icalproperty_new_description(bstr("description")));
651 while (prop = icalcomponent_get_first_property(vtodo,
652 ICAL_DTSTART_PROPERTY), prop != NULL) {
653 icalcomponent_remove_property(vtodo, prop);
654 icalproperty_free(prop);
656 icaltime_from_webform(&t, "dtstart");
657 icalcomponent_add_property(vtodo,
658 icalproperty_new_dtstart(t)
661 while (prop = icalcomponent_get_first_property(vtodo,
662 ICAL_DUE_PROPERTY), prop != NULL) {
663 icalcomponent_remove_property(vtodo, prop);
664 icalproperty_free(prop);
666 icaltime_from_webform(&t, "due");
667 icalcomponent_add_property(vtodo,
668 icalproperty_new_due(t)
671 /** Give this task a UID if it doesn't have one. */
672 lprintf(9, "Give this task a UID if it doesn't have one.\n");
673 if (icalcomponent_get_first_property(vtodo,
674 ICAL_UID_PROPERTY) == NULL) {
676 icalcomponent_add_property(vtodo,
677 icalproperty_new_uid(buf)
681 /** Increment the sequence ID */
682 lprintf(9, "Increment the sequence ID\n");
683 while (prop = icalcomponent_get_first_property(vtodo,
684 ICAL_SEQUENCE_PROPERTY), (prop != NULL) ) {
685 i = icalproperty_get_sequence(prop);
686 lprintf(9, "Sequence was %d\n", i);
687 if (i > sequence) sequence = i;
688 icalcomponent_remove_property(vtodo, prop);
689 icalproperty_free(prop);
692 lprintf(9, "New sequence is %d. Adding...\n", sequence);
693 icalcomponent_add_property(vtodo,
694 icalproperty_new_sequence(sequence)
698 * Encapsulate event into full VCALENDAR component. Clone it first,
699 * for two reasons: one, it's easier to just free the whole thing
700 * when we're done instead of unbundling, but more importantly, we
701 * can't encapsulate something that may already be encapsulated
704 lprintf(9, "Encapsulating into a full VCALENDAR component\n");
705 encaps = ical_encapsulate_subcomponent(icalcomponent_new_clone(vtodo));
707 /* Serialize it and save it to the message base */
708 serv_puts("ENT0 1|||4");
709 serv_getln(buf, sizeof buf);
711 serv_puts("Content-type: text/calendar");
713 serv_puts(icalcomponent_as_ical_string(encaps));
717 * Probably not necessary; the server will see the UID
718 * of the object and delete the old one anyway, but
723 icalcomponent_free(encaps);
727 * If the user clicked 'Delete' then explicitly delete the message.
729 if (!IsEmptyStr(bstr("delete_button"))) {
733 if ( (delete_existing) && (msgnum > 0L) ) {
734 serv_printf("DELE %ld", atol(bstr("msgnum")));
735 serv_getln(buf, sizeof buf);
738 if (created_new_vtodo) {
739 icalcomponent_free(vtodo);
742 /** Go back to the task list */
749 * \brief generic item handler
750 * Code common to all display handlers. Given a message number and a MIME
751 * type, we load the message and hunt for that MIME type. If found, we load
752 * the relevant part, deserialize it into a libical component, filter it for
753 * the requested object type, and feed it to the specified handler.
754 * \param mimetype mimetyp of our object
755 * \param which_kind sort of ical type
756 * \param msgnum number of the mesage in our db
757 * \param callback a funcion \todo
760 void display_using_handler(long msgnum,
762 icalcomponent_kind which_kind,
763 void (*callback)(icalcomponent *, long)
766 char mime_partnum[256];
767 char mime_filename[256];
768 char mime_content_type[256];
769 char mime_disposition[256];
771 char relevant_partnum[256];
772 char *relevant_source = NULL;
773 icalcomponent *cal, *c;
775 sprintf(buf, "MSG0 %ld|0", msgnum); /* unfortunately we need the mime headers */
777 serv_getln(buf, sizeof buf);
778 if (buf[0] != '1') return;
780 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
781 if (!strncasecmp(buf, "part=", 5)) {
782 extract_token(mime_filename, &buf[5], 1, '|', sizeof mime_filename);
783 extract_token(mime_partnum, &buf[5], 2, '|', sizeof mime_partnum);
784 extract_token(mime_disposition, &buf[5], 3, '|', sizeof mime_disposition);
785 extract_token(mime_content_type, &buf[5], 4, '|', sizeof mime_content_type);
786 mime_length = extract_int(&buf[5], 5);
788 if (!strcasecmp(mime_content_type, "text/calendar")) {
789 strcpy(relevant_partnum, mime_partnum);
795 if (!IsEmptyStr(relevant_partnum)) {
796 relevant_source = load_mimepart(msgnum, relevant_partnum);
797 if (relevant_source != NULL) {
799 cal = icalcomponent_new_from_string(relevant_source);
804 /** Simple components of desired type */
805 if (icalcomponent_isa(cal) == which_kind) {
806 callback(cal, msgnum);
809 /** Subcomponents of desired type */
810 for (c = icalcomponent_get_first_component(cal,
813 c = icalcomponent_get_next_component(cal,
817 icalcomponent_free(cal);
819 free(relevant_source);
826 * \brief display whole calendar
827 * \param msgnum number of the mesage in our db
829 void display_calendar(long msgnum) {
830 display_using_handler(msgnum, "text/calendar",
831 ICAL_VEVENT_COMPONENT,
832 display_individual_cal);
836 * \brief display whole taksview
837 * \param msgnum number of the mesage in our db
839 void display_task(long msgnum) {
840 display_using_handler(msgnum, "text/calendar",
841 ICAL_VTODO_COMPONENT,
842 display_individual_cal);
846 * \brief display the editor component for a task
848 void display_edit_task(void) {
851 /** Force change the room if we have to */
852 if (!IsEmptyStr(bstr("taskrm"))) {
853 gotoroom(bstr("taskrm"));
856 msgnum = atol(bstr("msgnum"));
859 display_using_handler(msgnum, "text/calendar",
860 ICAL_VTODO_COMPONENT,
861 display_edit_individual_task);
865 display_edit_individual_task(NULL, 0L);
870 *\brief save an edited task
872 void save_task(void) {
875 msgnum = atol(bstr("msgnum"));
877 display_using_handler(msgnum, "text/calendar",
878 ICAL_VTODO_COMPONENT,
879 save_individual_task);
882 save_individual_task(NULL, 0L);
887 * \brief display the editor component for an event
889 void display_edit_event(void) {
892 msgnum = atol(bstr("msgnum"));
895 display_using_handler(msgnum, "text/calendar",
896 ICAL_VEVENT_COMPONENT,
897 display_edit_individual_event);
901 display_edit_individual_event(NULL, 0L);
906 * \brief save an edited event
908 void save_event(void) {
911 msgnum = atol(bstr("msgnum"));
914 display_using_handler(msgnum, "text/calendar",
915 ICAL_VEVENT_COMPONENT,
916 save_individual_event);
919 save_individual_event(NULL, 0L);
928 * \brief freebusy display (for client software)
929 * \param req dunno. ?????
931 void do_freebusy(char *req) {
937 extract_token(who, req, 1, ' ', sizeof who);
938 if (!strncasecmp(who, "/freebusy/", 10)) {
939 strcpy(who, &who[10]);
944 if ( (!strcasecmp(&who[len-4], ".vcf"))
945 || (!strcasecmp(&who[len-4], ".ifb"))
946 || (!strcasecmp(&who[len-4], ".vfb")) ) {
950 lprintf(9, "freebusy requested for <%s>\n", who);
951 serv_printf("ICAL freebusy|%s", who);
952 serv_getln(buf, sizeof buf);
955 wprintf("HTTP/1.1 404 %s\n", &buf[4]);
956 output_headers(0, 0, 0, 0, 0, 0);
957 wprintf("Content-Type: text/plain\r\n");
959 wprintf("%s\n", &buf[4]);
963 fb = read_server_text();
964 http_transmit_thing(fb, strlen(fb), "text/calendar", 0);
970 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */