Skip to content
Snippets Groups Projects
Commit 43de37cc authored by Thomas Bruederli's avatar Thomas Bruederli
Browse files

Support %s variable in 'domain_filter' config option

Resolves T135
parent 780283f2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3063,13 +3063,18 @@ class Net_LDAP3
else {
$domain_base_dn = $this->config_get('domain_base_dn');
$domain_filter = $this->config_get('domain_filter');
$name_attribute = $this->config_get('domain_name_attribute');
 
if (empty($name_attribute)) {
$name_attribute = 'associateddomain';
if (strpos($domain_filter, '%s') !== false) {
$domain_filter = str_replace('%s', self::quote_string($domain), $domain_filter);
}
else {
$name_attribute = $this->config_get('domain_name_attribute');
if (empty($name_attribute)) {
$name_attribute = 'associateddomain';
}
 
$domain_filter = "(&" . $domain_filter . "(" . $name_attribute . "=" . self::quote_string($domain) . "))";
$domain_filter = "(&" . $domain_filter . "(" . $name_attribute . "=" . self::quote_string($domain) . "))";
}
 
if ($result = $this->search($domain_base_dn, $domain_filter, 'sub', $attributes)) {
$result = $result->entries(true);
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment