Do not send ldap records for users without a username set

If an app relies on the attribute to be set, apps like owncloud would
fail internally.
This commit is contained in:
Johannes Zellner
2017-03-03 10:18:36 +01:00
parent 9b8fa8a772
commit c07d322fff

View File

@@ -46,6 +46,9 @@ function userSearch(req, res, next) {
// send user objects
result.forEach(function (entry) {
// skip entries with empty username. Some apps like owncloud can't deal with this
if (!entry.username) return;
var dn = ldap.parseDN('cn=' + entry.id + ',ou=users,dc=cloudron');
var groups = [ GROUP_USERS_DN ];