1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Allow clearing user account email.

This commit is contained in:
Ylian Saint-Hilaire 2020-10-16 13:17:39 -07:00
parent 7b902f52e0
commit 6d1f757bfc
2 changed files with 7 additions and 5 deletions

View file

@ -1997,8 +1997,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Validate and change email
if (edituserdomain.usernameisemail !== true) {
if (common.validateString(command.email, 1, 1024) && (chguser.email != command.email)) {
if (command.email == '') { delete chguser.email; } else { chguser.email = command.email.toLowerCase(); }
if (common.validateString(command.email, 0, 1024) && (chguser.email != command.email)) {
if (command.email == '') { command.emailVerified = false; delete chguser.email; } else { chguser.email = command.email.toLowerCase(); }
change = 1;
}
}