From cc79bb1449d710f06290ee246e2f79872f987c5d Mon Sep 17 00:00:00 2001 From: Anthony Winstanley Date: Thu, 12 Nov 2020 09:34:28 -0800 Subject: [PATCH] Exclude blank LDAP attributes Asking for '' attributes is an error for some LDAP servers. --- app/Services/LdapAd.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/LdapAd.php b/app/Services/LdapAd.php index ab3e057957..5e495dc920 100644 --- a/app/Services/LdapAd.php +++ b/app/Services/LdapAd.php @@ -398,7 +398,7 @@ class LdapAd extends LdapAdConfiguration { /** @var Schema $schema */ $schema = new $this->ldapConfig['schema']; - return [ + return array_values(array_filter([ $this->ldapSettings['ldap_username_field'], $this->ldapSettings['ldap_fname_field'], $this->ldapSettings['ldap_lname_field'], @@ -409,7 +409,7 @@ class LdapAd extends LdapAdConfiguration $schema->userAccountControl(), $schema->title(), $schema->telephone(), - ]; + ])); } /**