diff --git a/api/src/Accounts/Import.php b/api/src/Accounts/Import.php index e8efad9070..32c08f07a1 100644 --- a/api/src/Accounts/Import.php +++ b/api/src/Accounts/Import.php @@ -339,6 +339,7 @@ class Import { // photo and public keys are not stored in SQL but in filesystem, fetch it to compare $contact['files'] = 0; + if ($contact['jpegphoto'] === false) $contact['jpegphoto'] = null; foreach($this->files2attrs as $file => [$attr, $mask, $regexp]) { if (isset($contact[$attr])) diff --git a/api/src/Contacts/Ads.php b/api/src/Contacts/Ads.php index 22cef304b6..b35e360116 100644 --- a/api/src/Contacts/Ads.php +++ b/api/src/Contacts/Ads.php @@ -84,7 +84,7 @@ class Ads extends Ldap */ function __construct(array $ldap_config=null, $ds=null) { - if (false) parent::__construct (); // quiten IDE warning, we are explicitly NOT calling parrent constructor! + if (false) parent::__construct (); // quiten IDE warning, we are explicitly NOT calling parent constructor! $this->accountName = $GLOBALS['egw_info']['user']['account_lid']; @@ -121,6 +121,15 @@ class Ads extends Ldap $this->ldapServerInfo = Api\Ldap\ServerInfo::get($this->ds, $this->ldap_config['ads_host']); $this->is_samba4 = $this->ldapServerInfo->serverType == Api\Ldap\ServerInfo::SAMBA4; + // check if there are any attributes defined via custom-fields + foreach(Api\Storage\Customfields::get('addressbook') as $cf) + { + if (substr($cf['name'], 0, 5) === 'ldap_') + { + $this->schema2egw[self::CF_OBJECTCLASS]['#'.$cf['name']] = strtolower(substr($cf['name'], 5)); + } + } + // AD seems to use user, instead of inetOrgPerson unset($this->schema2egw['posixaccount']); $this->schema2egw['user'] = array_merge($this->schema2egw['organizantionalperson'], array(