From d8e3f23342bfa511dad7dd4034a871444eacc137 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 8 Oct 2018 09:35:14 +0200 Subject: [PATCH] LdapCapabilities: Log which attributes were discovered --- library/Icinga/Protocol/Ldap/LdapCapabilities.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/library/Icinga/Protocol/Ldap/LdapCapabilities.php b/library/Icinga/Protocol/Ldap/LdapCapabilities.php index 5568aa5bb..0e562b115 100644 --- a/library/Icinga/Protocol/Ldap/LdapCapabilities.php +++ b/library/Icinga/Protocol/Ldap/LdapCapabilities.php @@ -3,6 +3,8 @@ namespace Icinga\Protocol\Ldap; +use Icinga\Application\Logger; + /** * The properties and capabilities of an LDAP server * @@ -347,6 +349,17 @@ class LdapCapabilities $cap = new LdapCapabilities($connection->cleanupAttributes(ldap_get_attributes($ds, $entry), $fields)); $cap->discoverAdConfigOptions($connection); + + if (isset($cap->attributes) && Logger::getInstance()->getLevel() === Logger::DEBUG) { + Logger::debug('Capability query discovered the following attributes:'); + foreach ($cap->attributes as $name => $value) { + if ($value !== null) { + Logger::debug(' %s = %s', $name, $value); + } + } + Logger::debug('Capability query attribute listing ended.'); + } + return $cap; }