From 03ec8043cad8b6fae3e95e2a05daa7f58392d612 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 2 Apr 2020 11:26:54 -0700 Subject: [PATCH] Fixed desktop input when user as only device rights. --- meshagent.js | 2 +- package.json | 2 +- views/default.handlebars | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) 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)));