mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-29 10:02:27 +03:00
Whitelist the supported LDAP attributes in order to avoid parsing issues with Samba AD servers
This commit is contained in:
parent
b49787ca5a
commit
9d7e0ba94e
2 changed files with 23 additions and 2 deletions
|
@ -94,7 +94,28 @@ const EVENT_MINIMUM_DURATION = 5; // Minutes
|
||||||
|
|
||||||
const DEFAULT_COMPANY_COLOR = '#ffffff';
|
const DEFAULT_COMPANY_COLOR = '#ffffff';
|
||||||
|
|
||||||
const LDAP_DEFAULT_FILTER = '(&(objectClass=person)(|(cn={{KEYWORD}})(sn={{KEYWORD}})(mail={{KEYWORD}})(givenName={{KEYWORD}})(uid={{KEYWORD}})))';
|
const LDAP_DEFAULT_FILTER = '(&(objectClass=*)(|(cn={{KEYWORD}})(sn={{KEYWORD}})(mail={{KEYWORD}})(givenName={{KEYWORD}})(uid={{KEYWORD}})))';
|
||||||
|
|
||||||
|
const LDAP_WHITELISTED_ATTRIBUTES = [
|
||||||
|
'givenname',
|
||||||
|
'cn',
|
||||||
|
'dn',
|
||||||
|
'sn',
|
||||||
|
'mail',
|
||||||
|
'telephonenumber',
|
||||||
|
'description',
|
||||||
|
'member',
|
||||||
|
'objectclass',
|
||||||
|
'objectcategory',
|
||||||
|
'instancetype',
|
||||||
|
'whencreated',
|
||||||
|
'name',
|
||||||
|
'samaccountname',
|
||||||
|
'samaccounttype',
|
||||||
|
'objectcategory',
|
||||||
|
'memberof',
|
||||||
|
'distinguishedname',
|
||||||
|
];
|
||||||
|
|
||||||
const LDAP_DEFAULT_FIELD_MAPPING = [
|
const LDAP_DEFAULT_FIELD_MAPPING = [
|
||||||
'first_name' => 'givenname',
|
'first_name' => 'givenname',
|
||||||
|
|
|
@ -221,7 +221,7 @@ class Ldap_client
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($ldap_entry as $key => $value) {
|
foreach ($ldap_entry as $key => $value) {
|
||||||
if (!is_array($value)) {
|
if (!is_array($value) || !in_array($key, LDAP_WHITELISTED_ATTRIBUTES)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue