diff --git a/plugins/authentication/ldap/ldap.php b/plugins/authentication/ldap/ldap.php index 9a70274c90cab..3cc208d782739 100644 --- a/plugins/authentication/ldap/ldap.php +++ b/plugins/authentication/ldap/ldap.php @@ -177,9 +177,9 @@ public function onUserAuthenticate($credentials, $options, &$response) } // Grab some details from LDAP and return them - $response->username = $entry->getAttribute($ldap_uid); - $response->email = $entry->getAttribute($ldap_email); - $response->fullname = $entry->getAttribute($ldap_fullname) ?: $credentials['username']; + $response->username = $entry->getAttribute($ldap_uid)[0] ?? false; + $response->email = $entry->getAttribute($ldap_email)[0] ?? false; + $response->fullname = $entry->getAttribute($ldap_fullname)[0] ?? trim($entry->geAttribute($ldap_fullname)[0]) ?: $credentials['username']; // Were good - So say so. $response->status = Authentication::STATUS_SUCCESS;