From 953d22244a7cd81b188d1263758c6b88af4aa3fc Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Fri, 6 Jun 2014 15:39:01 +0200 Subject: [PATCH] Add host discovery to authentication page Find all domains for a given hostname. refs #6093 Conflicts: application/forms/Install/AuthenticationPage.php --- library/Icinga/Protocol/Ldap/Connection.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index 13ae19fd9..70c97055d 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -353,10 +353,18 @@ class Connection return $dir; } - protected function discoverServerlistForDomain($domain) + public static function discoverServerlistForDomain($domain) { + $domains = array(); $ldaps_records = dns_get_record('_ldaps._tcp.' . $domain, DNS_SRV); + foreach ($ldaps_records as $record) { + $domains[$record['target']] = true; + } $ldap_records = dns_get_record('_ldap._tcp.' . $domain, DNS_SRV); + foreach ($ldap_records as $record) { + $domains[$record['target']] = true; + } + return array_keys($domains); } protected function prepareNewConnection()