diff --git a/src/externalldap.js b/src/externalldap.js index 7bba0db2f..233b06158 100644 --- a/src/externalldap.js +++ b/src/externalldap.js @@ -192,11 +192,15 @@ function sync(progressCallback, callback) { } if (error) { + debug('[adding user]', user.uid, user.mail, user.cn); + users.create(user.uid, null, user.mail, user.cn, { source: 'ldap' }, auditsource.EXTERNAL_LDAP_TASK, function (error) { if (error) console.error('Failed to create user', user, error); callback(); }); } else if (result.email !== user.mail || result.displayName !== user.cn) { + debug('[updating user]', user.uid, user.mail, user.cn); + users.update(result.id, { email: user.mail, displayName: user.cn }, auditsource.EXTERNAL_LDAP_TASK, function (error) { if (error) console.error('Failed to update user', user, error); callback();