diff --git a/meshuser.js b/meshuser.js index 6b9b1627..643df880 100644 --- a/meshuser.js +++ b/meshuser.js @@ -1705,7 +1705,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use else if ((parent.parent.mailserver != null) && (domain.auth != 'sspi') && (domain.auth != 'ldap') && (user.emailVerified !== true) && (user.siteadmin != 0xFFFFFFFF)) { err = 'Email verification required'; } // User must verify it's email first. // Create user group - else if ((common.validateString(command.name, 1, 64) == false) || (command.name.indexOf(' ') >= 0)) { err = 'Invalid group name'; } // User group name is between 1 and 64 characters + else if (common.validateString(command.name, 1, 64) == false) { err = 'Invalid group name'; } // User group name is between 1 and 64 characters else if ((command.desc != null) && (common.validateString(command.desc, 0, 1024) == false)) { err = 'Invalid group description'; } // User group description is between 0 and 1024 characters // If we are cloning from an existing user group, check that. @@ -1854,7 +1854,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use // Get the user group var group = parent.userGroups[command.ugrpid]; if (group != null) { - if ((common.validateString(command.name, 1, 64) == true) && (command.name != group.name) && (command.name.indexOf(' ') == -1)) { change = 'User group name changed from "' + group.name + '" to "' + command.name + '"'; group.name = command.name; } + if ((common.validateString(command.name, 1, 64) == true) && (command.name != group.name)) { change = 'User group name changed from "' + group.name + '" to "' + command.name + '"'; group.name = command.name; } if ((common.validateString(command.desc, 0, 1024) == true) && (command.desc != group.desc)) { if (change != '') change += ' and description changed'; else change += 'User group "' + group.name + '" description changed'; group.desc = command.desc; } if (change != '') { db.Set(group); diff --git a/views/default.handlebars b/views/default.handlebars index 97e4e008..0d16fdee 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2289,7 +2289,7 @@ if (message.event.desc) { ugroup.desc = message.event.desc; } else { delete ugroup.desc; } if (message.event.links) { ugroup.links = message.event.links; } else { delete ugroup.links; } } - masterUpdate(8192 + 16384); + masterUpdate(4096 + 8192 + 16384); // Group update, refresh all our device groups and nodes. TODO: Optimize this to only do this when needed. meshserver.send({ action: 'meshes' }); @@ -8383,7 +8383,8 @@ } if (sortedusers[i].id.startsWith('ugrp/')) { icon = 4; } var username = EscapeHtml(decodeURIComponent(sortedusers[i].name)); - if (users != null) { username = '' + username + ''; } + if ((usergroups != null) && sortedusers[i].id.startsWith('ugrp/')) { username = '' + username + ''; } + if ((users != null) && sortedusers[i].id.startsWith('user/')) { username = '' + username + ''; } x += '