diff --git a/api/src/Contacts/Ads.php b/api/src/Contacts/Ads.php index 811e28cf24..e836ed78ef 100644 --- a/api/src/Contacts/Ads.php +++ b/api/src/Contacts/Ads.php @@ -118,11 +118,8 @@ class Ads extends Ldap // AD seems to use user, instead of inetOrgPerson unset($this->schema2egw['posixaccount']); - $this->schema2egw['user'] = array_merge($this->schema2egw['inetorgperson'], array( + $this->schema2egw['user'] = array_merge($this->schema2egw['organizantionalperson'], array( 'account_id' => 'objectsid', - 'id' => 'objectguid', - 'uid' => 'objectguid', - 'n_fn' => 'displayname', // leave CN used in DN untouched 'accountexpires', 'useraccountcontrol', // needed to exclude deactivated or expired accounts )); unset($this->schema2egw['user']['n_fileas']); @@ -160,7 +157,7 @@ class Ads extends Ldap { // check that GUID eg. from URL contains only valid hex characters and dash // we cant use ldap::quote() for win2008r2 hex GUID, as it contains backslashes - if (!preg_match('/^[0-9A-Fa-f-]+/', $contact_id)) + if (strlen($contact_id) !== 36 || !preg_match('/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i', $contact_id)) { throw new Api\Exception\AssertionFailed("'$contact_id' is NOT a valid GUID!"); } diff --git a/api/src/Contacts/Ldap.php b/api/src/Contacts/Ldap.php index 8100947d03..bcdc42a30d 100644 --- a/api/src/Contacts/Ldap.php +++ b/api/src/Contacts/Ldap.php @@ -158,7 +158,39 @@ class Ldap 'uid' => 'entryuuid', 'id' => 'uid', ), - + 'organizantionalperson' => [ // ActiveDirectory + 'n_fn' => 'displayname', // to leave CN as part of DN untouched + 'n_given' => 'givenname', + 'n_family' => 'sn', + //'sound' => 'audio', + 'note' => 'description', + 'url' => 'url', + 'org_name' => 'company', + 'org_unit' => 'department', + 'title' => 'title', + 'adr_one_street' => 'streetaddress', + 'adr_one_locality' => 'l', + 'adr_one_region' => 'st', + 'adr_one_postalcode' => 'postalcode', + 'adr_one_countryname' => 'co', + 'adr_one_countrycode' => 'countrycode', + 'tel_work' => 'telephonenumber', + 'tel_home' => 'homephone', + 'tel_fax' => 'facsimiletelephonenumber', + 'tel_cell' => 'mobile', + 'tel_pager' => 'pager', + 'tel_other' => 'othertelephone', + 'tel_cell_private' => 'othermobile', + 'assistent' => 'assistant', + 'email' => 'mail', + 'room' => 'roomnumber', + 'jpegphoto' => 'jpegphoto', + 'n_fileas' => 'displayname', + 'label' => 'postaladdress', + 'pubkey' => 'usersmimecertificate', + 'uid' => 'objectguid', + 'id' => 'objectguid', + ], #displayName #mozillaCustom1 #mozillaCustom2