diff --git a/meshagent.js b/meshagent.js index 5841b644..e6bc17bf 100644 --- a/meshagent.js +++ b/meshagent.js @@ -687,7 +687,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { device = nodes[0]; // This device exists, meshid given by the device must be ignored, use the server side one. - if (device.meshid != obj.dbMeshKey) { + if ((device.meshid != null) && (device.meshid != obj.dbMeshKey)) { obj.dbMeshKey = device.meshid; obj.meshid = device.meshid.split('/')[2]; } diff --git a/package.json b/package.json index 3c973902..f55c84b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.5.0-z", + "version": "0.5.1-a", "keywords": [ "Remote Management", "Intel AMT", diff --git a/views/default.handlebars b/views/default.handlebars index d3758dc0..d921a61c 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2777,7 +2777,7 @@ if (!xxdialogMode && xxcurrentView == 11 && desktop && Q('DeskControl').checked) { // Check what keys we are allows to send if (currentNode != null) { - var meshrights = GetMeshRights(currentNode.meshid); + var meshrights = GetNodeRights(currentNode); var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0))); if (inputAllowed == false) return false; var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0))); @@ -2836,7 +2836,7 @@ if (!xxdialogMode && xxcurrentView == 11 && desktop && Q('DeskControl').checked) { // Check what keys we are allows to send if (currentNode != null) { - var meshrights = GetMeshRights(currentNode.meshid); + var meshrights = GetNodeRights(currentNode); var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0))); if (inputAllowed == false) return false; var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0))); @@ -2870,7 +2870,7 @@ if (!xxdialogMode && xxcurrentView == 11 && desktop && Q('DeskControl').checked) { // Check what keys we are allows to send if (currentNode != null) { - var meshrights = GetMeshRights(currentNode.meshid); + var meshrights = GetNodeRights(currentNode); var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0))); if (inputAllowed == false) return false; var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0)));