Commit d23a80a9 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1083 Check if defines are defined before defining, request

PR_EC_AB_HIDDEN from addressbook and ignore entry if it's set (as
ZP-916).

Released under the Affero GNU General Public License (AGPL) version 3.
parent 8e24abb9
...@@ -50,8 +50,15 @@ include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapicode.php'); ...@@ -50,8 +50,15 @@ include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapicode.php');
include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapiguid.php'); include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapiguid.php');
include_once(PATH_TO_ZPUSH .'lib/utils/utils.php'); include_once(PATH_TO_ZPUSH .'lib/utils/utils.php');
define('PR_EMS_AB_THUMBNAIL_PHOTO', mapi_prop_tag(PT_BINARY, 0x8C9E)); if (!defined('PR_EMS_AB_THUMBNAIL_PHOTO')) {
define('STORE_SUPPORTS_UNICODE', true); define('PR_EMS_AB_THUMBNAIL_PHOTO', mapi_prop_tag(PT_BINARY, 0x8C9E));
}
if (!defined('PR_EC_AB_HIDDEN')) {
define('PR_EC_AB_HIDDEN', mapi_prop_tag(PT_BOOLEAN, 0x67A7));
}
if (!defined('STORE_SUPPORTS_UNICODE')) {
define('STORE_SUPPORTS_UNICODE', true);
}
class Kopano extends ContactWorker { class Kopano extends ContactWorker {
const NAME = "Z-Push GAB2Contacts"; const NAME = "Z-Push GAB2Contacts";
...@@ -179,6 +186,7 @@ class Kopano extends ContactWorker { ...@@ -179,6 +186,7 @@ class Kopano extends ContactWorker {
PR_ORGANIZATIONAL_ID_NUMBER, PR_ORGANIZATIONAL_ID_NUMBER,
PR_DISPLAY_TYPE_EX, // fetch so we are able to ignore ROOM and EQUIPMENT PR_DISPLAY_TYPE_EX, // fetch so we are able to ignore ROOM and EQUIPMENT
PR_DISPLAY_NAME, // we want to look at it PR_DISPLAY_NAME, // we want to look at it
PR_EC_AB_HIDDEN,
/* not mappable /* not mappable
PR_BUSINESS_ADDRESS_POST_OFFICE_BOX, PR_BUSINESS_ADDRESS_POST_OFFICE_BOX,
PR_INITIALS, PR_INITIALS,
...@@ -221,6 +229,11 @@ class Kopano extends ContactWorker { ...@@ -221,6 +229,11 @@ class Kopano extends ContactWorker {
$ignored++; $ignored++;
continue; continue;
} }
// ignore hidden entries
elseif (isset($entry[PR_EC_AB_HIDDEN]) && $entry[PR_EC_AB_HIDDEN]) {
$ignored++;
continue;
}
// build a SyncContact for the GAB entry // build a SyncContact for the GAB entry
$contact = new SyncContact(); $contact = new SyncContact();
......
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