fixed issues with comma in DN

This commit is contained in:
Roland Gruber 2020-02-21 19:30:28 +01:00
parent 098c28339a
commit 5153f6ea17
2 changed files with 2 additions and 2 deletions

View File

@ -752,7 +752,7 @@ function searchLDAPByAttribute($name, $value, $objectClass, $attributes, $scopes
$filter = '';
$filterParts = array();
if ($name != null) {
$filterParts[] = '(' . $name . '=' . $value . ')';
$filterParts[] = '(' . $name . '=' . ldap_escape($value) . ')';
}
if ($objectClass != null) {
$filterParts[] = '(objectClass=' . $objectClass . ')';

View File

@ -573,7 +573,7 @@ class posixAccount extends baseModule implements passwordService {
$types = array('gon', 'group');
$gonList = array();
foreach ($types as $type) {
$gonFilter = '(|(&(objectClass=groupOfNames)(member=' . $this->getAccountContainer()->dn_orig . '))(&(objectClass=groupOfMembers)(member=' . $this->getAccountContainer()->dn_orig . '))(&(objectClass=groupOfUniqueNames)(uniqueMember=' . $this->getAccountContainer()->dn_orig . ')))';
$gonFilter = '(|(&(objectClass=groupOfNames)(member=' . ldap_escape($this->getAccountContainer()->dn_orig) . '))(&(objectClass=groupOfMembers)(member=' . $this->getAccountContainer()->dn_orig . '))(&(objectClass=groupOfUniqueNames)(uniqueMember=' . $this->getAccountContainer()->dn_orig . ')))';
if (!empty($typeSettings['filter_' . $type])) {
$typeFilter = $typeSettings['filter_' . $type];
if (strpos($typeFilter, '(') !== 0) {