fix ldap warning

This commit is contained in:
Yuri Kuznetsov
2023-09-26 11:31:53 +03:00
parent ee0bcb7685
commit 25b0077adc

View File

@@ -144,14 +144,17 @@ class Utils
* Normalize options to LDAP client format
*
* @param array<string, mixed> $options
*
* @return array<string, mixed>
*/
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;
}