diff --git a/application/Espo/Core/Authentication/Ldap/Utils.php b/application/Espo/Core/Authentication/Ldap/Utils.php index 8e4ae95e31..8144d91940 100644 --- a/application/Espo/Core/Authentication/Ldap/Utils.php +++ b/application/Espo/Core/Authentication/Ldap/Utils.php @@ -144,14 +144,17 @@ class Utils * Normalize options to LDAP client format * * @param array $options - * * @return array */ public function normalizeOptions(array $options): array { - $options['useSsl'] = (bool) ($options['useSsl'] == 'SSL'); - $options['useStartTls'] = (bool) ($options['useStartTls'] == 'TLS'); - $options['accountCanonicalForm'] = $this->accountCanonicalFormMap[$options['accountCanonicalForm']]; + $useSsl = ($options['useSsl'] ?? null) == 'SSL'; + $useStartTls = ($options['useStartTls'] ?? null) == 'TLS'; + $accountCanonicalFormKey = $options['accountCanonicalForm'] ?? 'Dn'; + + $options['useSsl'] = $useSsl; + $options['useStartTls'] = $useStartTls; + $options['accountCanonicalForm'] = $this->accountCanonicalFormMap[$accountCanonicalFormKey] ?? 1; return $options; }