* $Id$
*
* Editing calendar events.
+ *
+ * Copyright (c) 1996-2010 by the citadel.org team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "webcit.h"
char buf[SIZ];
int organizer_is_me = 0;
int i, j = 0;
+#ifdef DEBUG_UID_CALENDAR
int sequence = 0;
+#endif
char weekday_labels[7][32];
char month_labels[12][32];
long weekstart = 0;
int which_rrend_is_preselected;
int which_rryeartype_is_preselected;
-
+ const char *ch;
char *tabnames[3];
const char *frequency_units[8];
const char *ordinals[6];
/* Learn the sequence */
p = icalcomponent_get_first_property(vevent, ICAL_SEQUENCE_PROPERTY);
+#ifdef DEBUG_UID_CALENDAR
if (p != NULL) {
sequence = icalproperty_get_sequence(p);
}
+#endif
/* Begin output */
output_headers(1, 1, 2, 0, 0, 0);
wc_printf("<div class=\"fix_scrollbar_bug\">");
+#ifdef DEBUG_UID_CALENDAR
/************************************************************
* Uncomment this to see the UID in calendar events for debugging
+ *************************************************************/
wc_printf("UID == ");
p = icalcomponent_get_first_property(vevent, ICAL_UID_PROPERTY);
if (p != NULL) {
}
wc_printf("<br />\n");
wc_printf("SEQUENCE == %d<br />\n", sequence);
- *************************************************************/
+#endif
wc_printf("<form name=\"EventForm\" method=\"POST\" action=\"save_event\">\n");
wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDEE_PROPERTY);
attendee != NULL;
attendee = icalcomponent_get_next_property(vevent, ICAL_ATTENDEE_PROPERTY)) {
- strcpy(attendee_string, icalproperty_get_attendee(attendee));
- if (!strncasecmp(attendee_string, "MAILTO:", 7)) {
+
+ ch = icalproperty_get_attendee(attendee);
+ if ((ch != NULL) && !strncasecmp(ch, "MAILTO:", 7)) {
/* screen name or email address */
- strcpy(attendee_string, &attendee_string[7]);
+ safestrncpy(attendee_string, ch + 7, sizeof(attendee_string));
striplt(attendee_string);
if (i++) wc_printf("\n");
escputs(attendee_string);
char organizer_string[SIZ];
int sequence = 0;
enum icalproperty_transp formtransp = ICAL_TRANSP_NONE;
+ const char *ch;
if (supplied_vevent != NULL) {
vevent = supplied_vevent;
if (YESBSTR(buf)) recur.by_day[j++] =
icalrecurrencetype_day_day_of_week(i+1);
}
- recur.by_day[j++] = ICAL_RECURRENCE_ARRAY_MAX;
+ recur.by_day[j] = ICAL_RECURRENCE_ARRAY_MAX;
break;
case ICAL_MONTHLY_RECURRENCE:
foundit = 0;
for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDEE_PROPERTY); attendee != NULL; attendee = icalcomponent_get_next_property(vevent, ICAL_ATTENDEE_PROPERTY)) {
- if (!strcasecmp(attendee_string,
- icalproperty_get_attendee(attendee)))
+ ch = icalproperty_get_attendee(attendee);
+ if ((ch != NULL) && !strcasecmp(attendee_string, ch))
++foundit;
}
if (foundit == 0) {
icalcomponent_add_property(vevent,
- icalproperty_new_attendee(attendee_string)
+ icalproperty_new_attendee(attendee_string)
);
}
}
* Remove any attendees *not* listed in the web form
*/
STARTOVER: for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDEE_PROPERTY); attendee != NULL; attendee = icalcomponent_get_next_property(vevent, ICAL_ATTENDEE_PROPERTY)) {
- strcpy(attendee_string, icalproperty_get_attendee(attendee));
- if (!strncasecmp(attendee_string, "MAILTO:", 7)) {
- strcpy(attendee_string, &attendee_string[7]);
+ ch = icalproperty_get_attendee(attendee);
+ if ((ch != NULL) && !strncasecmp(ch, "MAILTO:", 7)) {
+ safestrncpy(attendee_string, ch + 7, sizeof(attendee_string));
striplt(attendee_string);
foundit = 0;
for (i=0; i<num_tokens(form_attendees, '\n'); ++i) {
summary();
}
else {
- readloop(readfwd);
+ readloop(readfwd, eUseDefault);
}
}
}