141 Commits

Author SHA1 Message Date
Andrew Ruthven
88fee9f155 The use of quote_dt_param removes the need to append 'T000000Z'
All tests still pass.
2024-03-01 23:42:54 +13:00
Andrew Ruthven
435133adf5 We need to have dtstart_orig be what is passed in, possibly empty.
Using quote_dt_param resolves the error that Benedikt Spranger was
fixing in 3f326f2d3fcc429d7596a4ff59970217161f7930.
2024-03-01 23:42:54 +13:00
Andrew Ruthven
1c7954fc51 Enforce dates to be send as string (fixes #233)
Prevents AWL/PG from converting them magically.
2024-03-01 23:42:21 +13:00
Benedikt Spranger
15f304ab1c Fix handling of events started before 1900
commit 15d01c8bed2d ("Store DTSTART and DTEND from user in shadow columns")
breaks handling of events started before 1900:

[19-Sep-2023 14:30:39 UTC] davical: BUG: :DAViCal Fatal Error: [42804] SQLSTATE[42804]: Datatype mismatch: 7 ERROR:  column "dtstart_orig" is of type timestamp with time zone but expression is of type integer
[19-Sep-2023 14:30:39 UTC] ================= Stack Trace ===================
[19-Sep-2023 14:30:39 UTC] davical: LOG: :Response status 500 for PUT /<user>/home/6bb3a62b-43ae-4a21-bb83-fca84d9ef050.ics
[19-Sep-2023 14:30:39 UTC] davical: LOG: :***************** Response Header ****************
[19-Sep-2023 14:30:39 UTC] davical: LOG: headers:-->Server: 1.1
[19-Sep-2023 14:30:39 UTC] davical: LOG: headers:-->DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
[19-Sep-2023 14:30:39 UTC] davical: LOG: headers:-->DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
[19-Sep-2023 14:30:39 UTC] davical: LOG: headers:-->X-DAViCal-Version: DAViCal/1.1.12; DB/1.3.5
[19-Sep-2023 14:30:39 UTC] davical: LOG: headers:-->Content-type: text/plain; charset="utf-8"
[19-Sep-2023 14:30:39 UTC] davical: LOG: :******************** Response ********************
[19-Sep-2023 14:30:39 UTC] davical: LOG: response:-->DAViCal Fatal Error

Update dtstart_orig in these cases to avoid the database failure.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
2024-03-01 23:26:26 +13:00
Andrew Ruthven
15d01c8bed Store DTSTART and DTEND from user in shadow columns
We want to store the calculated dtstart and dtend in the database so we can
use SQL to fetch records. However, we also need what the user sent us so we
can allow prop-filters to be used as well.

So we store what the user sends us in dtstart_orig and dtend_orig and only
use for relevant prop-filter reports.
2023-03-12 20:17:43 +01:00
Andrew Ruthven
149ec3555f CLASS is an optional field, don't set it to PUBLIC
As specified in RFC5545 the CLASS field is optional, and if it isn't present
is treated as PUBLIC. To allow a is-not-defined prop-filter to find
resources without CLASS set, we need to not store in the database. This
turns out to be okay, because to enforce privacy we always check to see if
it is PRIVATE or CONFIDENTIAL. We never check to see if it is PUBLIC.

Closes #284.
2023-03-12 20:05:48 +01:00
Andrew Ruthven
e3b5c331be Add a primary key to calendar_alarm table.
Also fixed a bug in scripts/refresh-alarms.php if there was an
alarm with a duplicate trigger.

This is part of the fix for #276.
2023-02-15 07:42:34 +00:00
Andrew Ruthven
02af0c58ee Further fixes for PHP 8.1
I don't know why this only show up in the gitlab runners. I have PHP 8.1
locally.
2022-02-13 01:04:47 +13:00
Andrew Ruthven
f1a4dcee0c More fixes for PHP 8.1 2022-02-12 23:59:26 +13:00
Andrew Ruthven
65ce5d443e Fix syntax 2019-11-26 22:51:37 +13:00
Andrew Ruthven
8e7866c550 Use a placeholder for another instance of collection_id 2019-11-26 22:24:49 +13:00
Cyprian Guerra
2ba1d64b0c fixing Invalid parameter number: :collection_id 2019-03-28 10:52:32 +01:00
Jamie McClymont
a2b393317d Populate first_instance_start and last_instance_end on resource write 2019-01-03 17:48:42 +13:00
Florian Schlichting
a51caa38f1 properly check if $row has been unset (fixes #141)
Also fix deprecation warnings introduced with PHP 7.3 about the use of
continue inside switch statements, see
https://wiki.php.net/rfc/continue_on_switch_deprecation
2018-12-22 19:13:13 +01:00
Frank Steinberg
9363a3d19a Improved handling of event modifications:
- only some event attributes modified by the organizer get also modified in attendees' instances of the event,
- revoked invitations mark the according attendee's event appropriately,
- a changed event time resets all attendees' PARTSTAT to NEEDS-ACTION.
2018-01-11 23:08:17 +01:00
Andrew McMillan
58cf5b01ad Correctly handle durations without units like "PT"
While this has always been handled in basic event parsing the handling
in VALARM components for related triggers was missing.
2018-01-10 14:10:12 +00:00
Florian Schlichting
50dd8a8d73 fix confusing comments 2017-10-04 23:28:03 +02:00
Florian Schlichting
6ad5511c1e fix "PHP Notice: Undefined property" warnings 2017-10-04 22:36:07 +02:00
Frank Steinberg
3bb6cd4479 Resolve attendee group names to lists of individual users. Configurable by $c->enable_attendee_group_resolution (from !21) 2017-09-21 23:27:51 +02:00
Florian Schlichting
202542dc1b updates for bulk addressbook import 2017-01-07 02:17:29 +01:00
Florian Schlichting
78669a3078 delete obsolete entries when updating addressbooks as external resources (see comment on !34) 2017-01-05 11:55:15 +01:00
Florian Schlichting
81e404264f Merge branch 'addressbook_sync_token' into 'master'
Allow updating addressbooks as external resources. (Closes #93)

Closes #93

See merge request !34
2017-01-05 10:31:11 +00:00
Florian Schlichting
eaef540766 replace RRule with RRule-v2 2016-12-30 08:54:14 +01:00
Florian Schlichting
eb7f2edc0c eliminate trailing whitespace, expand tabs 2016-12-30 08:52:44 +01:00
Andrew Ruthven
64be7d3127 Allow updating addressbooks as external resources. (Closes #93)
Previously if an addressbook was an external resource, then all local
info was deleted, and all the remote addressbook entries were
re-inserted, potentially creating new sync tokens.

This change only updates modified records.
2016-12-08 15:39:12 +13:00
Frank Steinberg
136fc88c12 Fixed some logging labels. 2016-09-15 00:40:46 +02:00
Florian Schlichting
bb8ae530f5 a helpful comment
(and a lot of whitespace cleanup)
2016-09-14 23:46:41 +02:00
Andrew McMillan
eb80496511 Provide some more useful error details in various PUT failure situations. 2016-06-22 22:36:06 +01:00
Andrew McMillan
0f41ade035 Bugs pointed out by PHPStorm. 2016-06-22 22:27:16 +01:00
Florian Schlichting
71e27e50cb fix Thunderbird mutilating external attendees
semicolon is a separator in iCal, and even though we send it enclosed in
double quotes TB will choke on it and produce a mess
2016-01-08 14:27:37 +01:00
Florian Schlichting
fd5e7450f2 Fix scheduling replies with mixed internal and external (ignored) attendees
"new DAVPrincipal" always returns an object, so $attendee_principal will
never be false
2016-01-06 16:04:00 +01:00
Benedikt Spranger
c35704cc4b handle events started before 1900 (closes: #58)
DTSTART/DTEND can be DATE values instead of DATE-TIME. Our database uses
TIMESTAMP WITH TIME ZONE as field type, which seems to accept 19011224
but not values before 1900, such as 18961224. This patch changes values
between 1000 and 1900 to DATE-TIME by adding "T000000Z"

Patch contributed by Benedikt Spranger <b.spranger@linutronix.de>

Patch limited to dates between 1000 and 1900 by Florian Schlichting
<fsfs@debian.org>
2016-01-01 22:36:25 +01:00
Florian Schlichting
e3789ba10e set dav_name of imported address books to .vcf instead of .ics (fixes #39)
and correct a number of typos and documentation inaccuracies on the way
2015-10-02 23:58:33 +02:00
Matthias
da750a8092 Fixed broken import function (fixes #38) 2015-04-22 13:31:10 +02:00
Kribbio
af774dd89c Create array Organizer for merged with array Attendee on 'handle_schedule_reply' function. 2014-09-25 10:36:41 +12:00
Kribbio
bddab50aac Name property is 'schedule-inbox' and not 'schedule_inbox' 2014-09-25 10:27:45 +12:00
“Paul
96a5a31203 Fixed fetching new external resources on BIND 2014-06-23 21:55:11 +02:00
Ján Máté
31af435cec various cheduling related fixes (there are still few remaining bugs) 2014-05-14 13:32:48 +02:00
Christoph Anton Mitterer
c092a6153e make debug files pathnames more FHS compliant
* Changed the pathnames of the debug files to be a bit more FHS compliant.
2013-09-02 14:40:46 +12:00
Christoph Anton Mitterer
8e60bb3124 set line endings of most text files to LF
* Changed the end-of-line encodings of all non-Windows-related and non-autogenerated text files to use UNIX LF (lots of them had mixed LF/CRLF).

Conflicts:
	inc/caldav-PUT-functions.php
2013-09-02 14:37:23 +12:00
Matthias
92c15bed64 Fixed schedule reply handling for missing organizer 2013-09-02 14:27:40 +12:00
Andrew McMillan
bc5edf09cf Handle the ?after=(duration|date) syntax when receiving a PUT of a calendar. 2013-05-29 12:50:50 +12:00
Andrew McMillan
5200c6d996 Allow adding an 'after=YYYY-MM-DD' or 'after=P72D' parameter
Only applies to PUT of a collection.  This will mean that only events
after that date (or absolute duration prior to today).  All repeating
events will still be included.
2013-05-23 13:37:00 +12:00
Andrew McMillan
8417e59918 Better timezone handling for alarm times. 2012-06-30 16:03:53 +12:00
Andrew McMillan
35a5518971 Catch 'events' without a DTSTART gracefully and ignore them. 2012-06-25 08:02:08 +12:00
Frank Steinberg
0c582b9147 Attendees can only modify own event instance and own PARTSTAT on all attendees' instances. Lookup event upon incoming scheduling messages in ANY calendar, not just the default schedule calendar.
Hi,

this proposed patch does the following:

- When an attendee (not the organizer) modifies an object, these modifications should be applied completely to that user's instance of the object. However, the organizer's and other attendees' instances should not be modified in most aspects: Only the attendee's own PARTSTAT modification should be distributed to the organizer's and other attendees' instances. E.g. modifications on VALARMs or TRANSP settings are individual to that single user that sends the modification.
  However, I have doubts whether the organizer should be able to apply such modifications on all attendees' instances, once they exist for other attendees. Currently, I did not yet change this behavior.

- When a user receives an invitation in his schedule-default-calendar, he might move it to another calendar. When a subsequent modification to the event arrives, another instance (with the same UID!), is created in the schedule-default-calendar. This patch makes the server search for an instance of the event in any of the receiving user's calendar, so that no event duplicates are created.

I am not really familiar with the code as a whole, so that the way I implemented these changes is probably not "correct".

Regards,

 -frank
2012-05-07 09:30:03 +12:00
Andrew McMillan
11cb332603 Make sure we increment the sync-token on PUT / DELETE. 2012-04-11 00:39:07 +12:00
Andrew McMillan
a34203a7b8 Sometimes we want the action hook to be post commit.
This adds another hook, and makes log_caldav_action() regular
across both PUT and DELETE (in a transaction), adding post_commit_hook()
as a method with the same signature which is called after the actual
commit, and also matches in both cases.
2012-04-10 23:30:07 +12:00
Andrew McMillan
7a3f2c4744 Make it so that PUT of a calendar collection becomes a synchronisation.
We only write events which differ, and only delete events which aren't
present in the new upload.  If done in append mode then events which
already exist will be updated more cleanly too.
2012-04-06 14:03:55 +12:00
Andrew McMillan
9c7083be24 Fix problems calling import collection from external contexts. 2012-01-30 22:25:03 -08:00