From: Art Cancro Date: Sat, 30 Nov 2002 21:34:51 +0000 (+0000) Subject: * Submit organizer in a hidden field, in case the server needs it X-Git-Tag: v7.86~6100 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=463240758436a10b316a2e9f27ec554869548513;p=citadel.git * Submit organizer in a hidden field, in case the server needs it --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 68e45014a..53850d394 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 400.60 2002/11/30 21:34:51 ajc +* Submit organizer in a hidden field, in case the server needs it + Revision 400.59 2002/11/30 04:46:46 ajc * First cut at adding/removing attendees to an event (Actual invitations should be sent by the Citadel server) @@ -1154,4 +1157,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix - diff --git a/webcit/event.c b/webcit/event.c index 0af2eec1d..dda0dded0 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -242,6 +242,17 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) wprintf(" " "(you are the organizer)\n"); } + + /* + * Transmit the organizer as a hidden field. We don't want the user + * to be able to change it, but we do want it fed back to the server, + * especially if this is a new event and there is no organizer already + * in the calendar object. + */ + wprintf(""); + wprintf("\n"); /* Attendees (do more with this later) */ @@ -328,6 +339,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { int i; int foundit; char form_attendees[SIZ]; + char organizer_string[SIZ]; if (supplied_vevent != NULL) { vevent = supplied_vevent; @@ -434,6 +446,22 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { ); } + /* Set the organizer, only if one does not already exist *and* + * the form is supplying one + */ + strcpy(buf, bstr("organizer")); + if ( (icalcomponent_get_first_property(vevent, + ICAL_ORGANIZER_PROPERTY) == NULL) + && (strlen(buf) > 0) ) { + + /* set new organizer */ + sprintf(organizer_string, "MAILTO:%s", buf); + icalcomponent_add_property(vevent, + icalproperty_new_organizer(organizer_string) + ); + + } + /* * Add any new attendees listed in the web form */