LdapCapabilities: Log which attributes were discovered

This commit is contained in:
Johannes Meyer 2018-10-08 09:35:14 +02:00
parent 3c69a63ce3
commit d8e3f23342
1 changed files with 13 additions and 0 deletions

View File

@ -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;
}