Commit 6d7d21e5 authored by skummer's avatar skummer

ZP-460 #comment added configuration parameter SYNC_CONTACTS_MAXPICTURESIZE #time 30m

git-svn-id: https://z-push.org/svn/z-push/trunk@1758 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 33a542a2
......@@ -181,6 +181,13 @@
// true - unset properties which are not sent during Sync
define('UNSET_UNDEFINED_PROPERTIES', false);
// ActiveSync specifies that a contact photo may not exceed 48 KB. This value is checked
// in the semantic sanity checks and contacts with larger photos are not synchronized.
// This limitation is not being followed by the ActiveSync clients which set much bigger
// contact photos. You can override the default value of the max photo size.
// default: 49152 - 48 KB default max photo size in bytes
define(SYNC_CONTACTS_MAXPICTURESIZE, 49152);
/**********************************************************************************
* Backend settings
*/
......
......@@ -274,6 +274,12 @@ class ZPush {
else if (SINK_FORCERECHECK !== false && (!is_int(SINK_FORCERECHECK) || SINK_FORCERECHECK < 1))
throw new FatalMisconfigurationException("The SINK_FORCERECHECK value must be 'false' or a number higher than 0.");
if (!defined('SYNC_CONTACTS_MAXPICTURESIZE')) {
define('SYNC_CONTACTS_MAXPICTURESIZE', 49152);
}
else if ((!is_int(SYNC_CONTACTS_MAXPICTURESIZE) || SYNC_CONTACTS_MAXPICTURESIZE < 1))
throw new FatalMisconfigurationException("The SYNC_CONTACTS_MAXPICTURESIZE value must be a number higher than 0.");
// the check on additional folders will not throw hard errors, as this is probably changed on live systems
if (isset($additionalFolders) && !is_array($additionalFolders))
ZLog::Write(LOGLEVEL_ERROR, "ZPush::CheckConfig() : The additional folders synchronization not available as array.");
......
......@@ -174,7 +174,7 @@ class SyncContact extends SyncObject {
SYNC_POOMCONTACTS_YOMILASTNAME => array ( self::STREAMER_VAR => "yomilastname"),
SYNC_POOMCONTACTS_RTF => array ( self::STREAMER_VAR => "rtf"),
SYNC_POOMCONTACTS_PICTURE => array ( self::STREAMER_VAR => "picture",
self::STREAMER_CHECKS => array( self::STREAMER_CHECK_LENGTHMAX => 49152 )),
self::STREAMER_CHECKS => array( self::STREAMER_CHECK_LENGTHMAX => SYNC_CONTACTS_MAXPICTURESIZE )),
SYNC_POOMCONTACTS_CATEGORIES => array ( self::STREAMER_VAR => "categories",
self::STREAMER_ARRAY => SYNC_POOMCONTACTS_CATEGORY ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment