diff --git a/config/example-config.php b/config/example-config.php index b19eb93b..47adc43e 100644 --- a/config/example-config.php +++ b/config/example-config.php @@ -171,6 +171,17 @@ $c->admin_email ='calendar-admin@example.com'; // $c->home_calendar_name = 'calendar'; // $c->home_addressbook_name = 'addresses'; +/** +* Sets a numeric value indicating the maximum size in octets (bytes) of a resource +* that the server is willing to accept when an address object resource is stored +* in an address book collection (e.g. contacts with image attachments). +* Note that not all clients respect that property and that DAViCal won't deny creating +* or updating a resource that is larger than the specified limit if the client willingly or +* unwillingly ignores that property. Currently (late 2018) we only know of iOS devices to handle it properly. +* Default: 6550000 +*/ +// $c->carddav_max_resource_size = 6550000; + /** * If the above options are not suitable for your new users, use this to create * a more complex default collection management. diff --git a/htdocs/always.php b/htdocs/always.php index b4de04e0..f32b0b9d 100644 --- a/htdocs/always.php +++ b/htdocs/always.php @@ -83,6 +83,7 @@ $c->permission_scan_depth = 2; $c->expand_pdo_parameters = true; $c->home_calendar_name = 'calendar'; $c->home_addressbook_name = 'addresses'; +$c->carddav_max_resource_size = 6550000; $c->enable_row_linking = true; $c->enable_scheduling = false; $c->http_auth_mode = 'Basic'; diff --git a/inc/DAVResource.php b/inc/DAVResource.php index 4b34cee1..f6220b27 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -1842,7 +1842,7 @@ EOQRY; case 'urn:ietf:params:xml:ns:carddav:max-resource-size': if ( ! $this->_is_collection || !$this->_is_addressbook ) return false; - $reply->NSElement($prop, $tag, '' ); + $reply->NSElement($prop, $tag, $c->carddav_max_resource_size ); break; case 'urn:ietf:params:xml:ns:carddav:supported-address-data': diff --git a/inc/always.php.in b/inc/always.php.in index e511655a..3f151df0 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -83,6 +83,7 @@ $c->permission_scan_depth = 2; $c->expand_pdo_parameters = true; $c->home_calendar_name = 'calendar'; $c->home_addressbook_name = 'addresses'; +$c->carddav_max_resource_size = 6550000; $c->enable_row_linking = true; $c->enable_scheduling = false; $c->http_auth_mode = 'Basic';