ldap: sync email address

This commit is contained in:
Girish Ramakrishnan 2020-11-03 14:25:42 -08:00
parent a74bc81ff8
commit e79e0cfb66

View file

@ -247,6 +247,22 @@ export function syncUserData(user, ldapUser) {
}
}
if (LDAP.settings_get('LDAP_EMAIL_FIELD') !== '') {
const email = getLdapEmail(ldapUser);
log_debug('email=', email);
if (user && user._id && email !== '') {
log_info('Syncing user email:', email);
Meteor.users.update({
_id: user._id
}, {
$set: {
'emails.0.address': email,
}
});
}
}
}
export function addLdapUser(ldapUser, username, password) {