Create and update users from external ldap
This commit is contained in:
@@ -137,7 +137,7 @@ function validatePassword(password) {
|
||||
|
||||
// remove all fields that should never be sent out via REST API
|
||||
function removePrivateFields(user) {
|
||||
return _.pick(user, 'id', 'username', 'email', 'fallbackEmail', 'displayName', 'groupIds', 'admin', 'active');
|
||||
return _.pick(user, 'id', 'username', 'email', 'fallbackEmail', 'displayName', 'groupIds', 'admin', 'active', 'source');
|
||||
}
|
||||
|
||||
// remove all fields that Non-privileged users must not see
|
||||
@@ -155,6 +155,7 @@ function create(username, password, email, displayName, options, auditSource, ca
|
||||
|
||||
const isOwner = !!options.owner;
|
||||
const isAdmin = !!options.admin;
|
||||
const source = options.source || ''; // empty is local user
|
||||
const invitor = options.invitor || null;
|
||||
|
||||
var error;
|
||||
@@ -197,7 +198,8 @@ function create(username, password, email, displayName, options, auditSource, ca
|
||||
modifiedAt: now,
|
||||
resetToken: '',
|
||||
displayName: displayName,
|
||||
admin: isOwner || isAdmin
|
||||
admin: isOwner || isAdmin,
|
||||
source: source
|
||||
};
|
||||
|
||||
userdb.add(user.id, user, function (error) {
|
||||
|
||||
Reference in New Issue
Block a user