diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php index a4e3bca4dae2fc546601d1cdf109991411ce4bac..8d908a61697d45d1e87c9d006928d534444ed770 100644 --- a/lib/Net/LDAP3.php +++ b/lib/Net/LDAP3.php @@ -3179,6 +3179,7 @@ class Net_LDAP3 // use cache $domain_dn = $this->get_cache_data($ckey); + $result = false; if ($domain_dn) { $result = $this->get_entry_attributes($domain_dn, $attributes); @@ -3186,9 +3187,6 @@ class Net_LDAP3 if (!empty($result)) { $result['dn'] = $domain_dn; } - else { - $result = false; - } } else if ($domain_base_dn = $this->config_get('domain_base_dn')) { $domain_filter = $this->config_get('domain_filter'); @@ -3209,10 +3207,7 @@ class Net_LDAP3 $result = $result->entries(true); $domain_dn = key($result); - if (empty($domain_dn)) { - $result = false; - } - else { + if (!empty($domain_dn)) { $result = $result[$domain_dn]; $result['dn'] = $domain_dn;