From: Art Cancro Date: Fri, 29 Nov 2002 16:38:37 +0000 (+0000) Subject: * Started some "me as organizer" stuff. (BROKEN BUILD ... I'll fix soon.) X-Git-Tag: v7.86~6104 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=34fad51b0ed575eef472584db194f31fcf53ae59;p=citadel.git * Started some "me as organizer" stuff. (BROKEN BUILD ... I'll fix soon.) --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 29efded2b..dc70f01c8 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 400.57 2002/11/29 16:38:37 ajc +* Started some "me as organizer" stuff. (BROKEN BUILD ... I'll fix soon.) + Revision 400.56 2002/11/28 06:03:24 ajc * Issue an ISME command when editing an event, to determine whether the user viewing the event is the organizer. (Will use this later to allow/disallow @@ -1142,3 +1145,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/auth.c b/webcit/auth.c index 5633b238b..937516374 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -131,6 +131,7 @@ void do_login(void) WC->new_mail = extract_int(&buf[4], 0); need_regi = extract_int(&buf[4], 1); WC->need_vali = extract_int(&buf[4], 2); + extract(WC->cs_inet_email, &buf[4], 3); } if (need_regi) { display_reg(1); diff --git a/webcit/calendar.c b/webcit/calendar.c index 2f903ec34..7c436ccad 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -496,6 +496,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) { while (prop = icalcomponent_get_first_property(vtodo, ICAL_SUMMARY_PROPERTY), prop != NULL) { icalcomponent_remove_property(vtodo, prop); + icalproperty_free(prop); } icalcomponent_add_property(vtodo, icalproperty_new_summary(bstr("summary"))); @@ -503,6 +504,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) { while (prop = icalcomponent_get_first_property(vtodo, ICAL_DESCRIPTION_PROPERTY), prop != NULL) { icalcomponent_remove_property(vtodo, prop); + icalproperty_free(prop); } icalcomponent_add_property(vtodo, icalproperty_new_description(bstr("description"))); @@ -510,6 +512,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) { while (prop = icalcomponent_get_first_property(vtodo, ICAL_DTSTART_PROPERTY), prop != NULL) { icalcomponent_remove_property(vtodo, prop); + icalproperty_free(prop); } icalcomponent_add_property(vtodo, icalproperty_new_dtstart( @@ -520,6 +523,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) { while (prop = icalcomponent_get_first_property(vtodo, ICAL_DUE_PROPERTY), prop != NULL) { icalcomponent_remove_property(vtodo, prop); + icalproperty_free(prop); } icalcomponent_add_property(vtodo, icalproperty_new_due( diff --git a/webcit/event.c b/webcit/event.c index 1c366ef3c..9959412c0 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -30,7 +30,6 @@ #ifdef HAVE_ICAL_H - /* * Display an event by itself (for editing) */ @@ -40,6 +39,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) struct icaltimetype t_start, t_end; time_t now; int created_new_vevent = 0; + icalorganizertype me_as_organizer; icalproperty *organizer = NULL; char organizer_string[SIZ]; icalproperty *attendee = NULL; @@ -209,6 +209,17 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) } wprintf(""); + /* For a new event, the user creating the event should be the + * organizer. Set this field accordingly. + */ + if (icalcomponent_get_first_property(vevent, ICAL_ORGANIZER_PROPERTY) + == NULL) { + sprintf(organizer_string, "MAILTO:%s", WC->cs_inet_email); + memset(&me_as_organizer, 0, sizeof(icalorganizertype)); + me_as_organizer.value = strdup(organizer_string); + icalcomponent_set_organizer(vevent, me_as_organizer); + } + /* Determine who is the organizer of this event. This is useless * for now, but we'll need to determine "me" or "not me" soon. */ @@ -326,6 +337,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { while (prop = icalcomponent_get_first_property(vevent, ICAL_SUMMARY_PROPERTY), prop != NULL) { icalcomponent_remove_property(vevent, prop); + icalproperty_free(prop); } icalcomponent_add_property(vevent, icalproperty_new_summary(bstr("summary"))); @@ -333,6 +345,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { while (prop = icalcomponent_get_first_property(vevent, ICAL_LOCATION_PROPERTY), prop != NULL) { icalcomponent_remove_property(vevent, prop); + icalproperty_free(prop); } icalcomponent_add_property(vevent, icalproperty_new_location(bstr("location"))); @@ -340,6 +353,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { while (prop = icalcomponent_get_first_property(vevent, ICAL_DESCRIPTION_PROPERTY), prop != NULL) { icalcomponent_remove_property(vevent, prop); + icalproperty_free(prop); } icalcomponent_add_property(vevent, icalproperty_new_description(bstr("description"))); @@ -347,6 +361,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { while (prop = icalcomponent_get_first_property(vevent, ICAL_DTSTART_PROPERTY), prop != NULL) { icalcomponent_remove_property(vevent, prop); + icalproperty_free(prop); } if (!strcmp(bstr("alldayevent"), "yes")) { @@ -388,10 +403,12 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { while (prop = icalcomponent_get_first_property(vevent, ICAL_DTEND_PROPERTY), prop != NULL) { icalcomponent_remove_property(vevent, prop); + icalproperty_free(prop); } while (prop = icalcomponent_get_first_property(vevent, ICAL_DURATION_PROPERTY), prop != NULL) { icalcomponent_remove_property(vevent, prop); + icalproperty_free(prop); } if (all_day_event == 0) { diff --git a/webcit/webcit.h b/webcit/webcit.h index 294762e38..e2c6ff1b9 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -160,6 +160,7 @@ struct wcsession { int new_mail; int remember_new_mail; int need_vali; + char cs_inet_email[SIZ]; /* User's preferred Internet addr. */ pthread_mutex_t SessionMutex; /* mutex for exclusive access */ time_t lastreq; /* Timestamp of most recent HTTP */ int killthis; /* Nonzero == purge this session */