From 85c0490bf6a7808c0973d6df0c62e65936d72e17 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 5 Apr 2020 17:44:54 -0700 Subject: [PATCH] Fixed server crash when adding unknown user to device group. --- meshuser.js | 6 +++--- package.json | 3 ++- views/default.handlebars | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/meshuser.js b/meshuser.js index 6e6d99b8..1c860cb2 100644 --- a/meshuser.js +++ b/meshuser.js @@ -2438,11 +2438,11 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use var event = { etype: 'mesh', username: newuser.name, userid: user._id, meshid: mesh._id, name: mesh.name, mtype: mesh.mtype, desc: mesh.desc, action: 'meshchange', links: mesh.links, msg: 'Added user ' + newuser.name + ' to mesh ' + mesh.name, domain: domain.id, invite: mesh.invite }; if (db.changeStream) { event.noact = 1; } // If DB change stream is active, don't use this event to change the mesh. Another event will come. parent.parent.DispatchEvent(['*', mesh._id, user._id, newuserid], obj, event); - msgs.push("Added user " + newuser._id.split('/')[2]); + msgs.push("Added user " + newuserid.split('/')[2]); successCount++; } else { - msgs.push("Unknown user " + newuserid._id.split('/')[2]); - unknownUsers.push(newuserid); + msgs.push("Unknown user " + newuserid.split('/')[2]); + unknownUsers.push(newuserid.split('/')[2]); failCount++; } } diff --git a/package.json b/package.json index 89261179..1c625892 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.5.1-e", + "version": "0.5.1-g", "keywords": [ "Remote Management", "Intel AMT", @@ -20,6 +20,7 @@ "amt", "bin", "views", + "emails", "agents", "public", "translate", diff --git a/views/default.handlebars b/views/default.handlebars index 26371696..4bbc25d0 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -9115,7 +9115,7 @@ h = '
 ' + right + '
' + shortname + '
'; } else { var link = shortname, publiclink = ''; - if (publicfolder) { publiclink = ' (' + "Link" + ')'; } + if (publicfolder) { publiclink = ' '; } if (f.s > 0) { link = '' + shortname + '' + publiclink; } h = '
 ' + fdatestr + '' + fsize + '
' + link + '
'; } @@ -9166,7 +9166,7 @@ } function p5showPublicLink(u) { - setDialogMode(2, "Public Link", 1, null, ''); + setDialogMode(2, "Public Link", 1, null, ' '); return false; }