From 5e153a1a48b9164a0398263a8818ab3dcb791599 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 29 Jun 2013 11:41:55 +0000 Subject: [PATCH] fixed CardDAV for accounts in ADS --- addressbook/inc/class.addressbook_ads.inc.php | 14 ++++++-------- addressbook/inc/class.addressbook_groupdav.inc.php | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/addressbook/inc/class.addressbook_ads.inc.php b/addressbook/inc/class.addressbook_ads.inc.php index 333a712f47..f9ae7ec57c 100644 --- a/addressbook/inc/class.addressbook_ads.inc.php +++ b/addressbook/inc/class.addressbook_ads.inc.php @@ -108,15 +108,13 @@ class addressbook_ads extends addressbook_ldap // AD seems to use user, instead of inetOrgPerson unset($this->schema2egw['posixaccount']); - $this->schema2egw['user'] = $this->schema2egw['inetorgperson']; - $this->schema2egw['user'] += array( + $this->schema2egw['user'] = array_merge($this->schema2egw['inetorgperson'], array( 'account_id' => 'objectsid', - 'account_lid' => 'samaccountname', - 'contact_uid' => 'objectguid', + 'id' => 'objectguid', + 'uid' => 'objectguid', + 'n_fn' => 'displayname', // leave CN used in DN untouched 'accountexpires', 'useraccountcontrol', // needed to exclude deactivated or expired accounts - ); - $this->schema2egw['user']['n_fn'] = 'displayname'; // leave CN used in DN untouched - + )); foreach($this->schema2egw as $schema => $attributes) { $this->all_attributes = array_merge($this->all_attributes,array_values($attributes)); @@ -189,7 +187,7 @@ class addressbook_ads extends addressbook_ldap function _user2egw(&$contact, $data) { $contact['account_id'] = $this->accounts_ads->objectsid2account_id($data['objectsid']); - $contact['id'] = $contact['contact_uid'] = $this->accounts_ads->objectguid2str($data['objectguid']); + $contact['id'] = $contact['uid'] = $this->accounts_ads->objectguid2str($data['objectguid']); // ignore system accounts if ($contact['account_id'] < accounts_ads::MIN_ACCOUNT_ID) return false; diff --git a/addressbook/inc/class.addressbook_groupdav.inc.php b/addressbook/inc/class.addressbook_groupdav.inc.php index 5946c63eea..e53a089fac 100644 --- a/addressbook/inc/class.addressbook_groupdav.inc.php +++ b/addressbook/inc/class.addressbook_groupdav.inc.php @@ -74,8 +74,8 @@ class addressbook_groupdav extends groupdav_handler // since 1.9.007 we allow clients to specify the URL when creating a new contact, as specified by CardDAV // LDAP does NOT have a carddav_name attribute --> stick with id mapped to LDAP attribute uid if (version_compare($GLOBALS['egw_info']['apps']['phpgwapi']['version'], '1.9.007', '<') || - $this->bo->contact_repository == 'ldap' || - $this->bo->account_repository == 'ldap' && strpos($_SERVER['REQUEST_URI'].'/','/addressbook-accounts/') !== false) + $this->bo->contact_repository != 'sql' || + $this->bo->account_repository != 'sql' && strpos($_SERVER['REQUEST_URI'].'/','/addressbook-accounts/') !== false) { groupdav_handler::$path_extension = '.vcf'; }