From b2df4de6493cbedb224b46eb5e2d5b1b7e0feec7 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 14 Jul 2021 09:53:33 -0700 Subject: [PATCH] Added option to disable local record/screenshot options, #2901. --- meshcentral-config-schema.json | 1 + views/default.handlebars | 4 ++-- webserver.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 836ef518..c74602cc 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -643,6 +643,7 @@ }, "httpHeaders": { "type": "object", "additionalProperties": { "type": "string" } }, "agentConfig": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, + "localSessionRecording": { "type": "boolean", "default": true, "description": "When false, removes the local recording feature on remote desktop." }, "sessionRecording": { "type": "object", "additionalProperties": false, diff --git a/views/default.handlebars b/views/default.handlebars index 22ec0855..8807e66b 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -7721,8 +7721,8 @@ if (deskState != 3) { QV('DeskInputLockedButton', false); QV('DeskInputUnLockedButton', false); } // Display this only if we have Chat & Notify permissions - QV('DeskSaveImageButton', (deskState == 3) && (Q('Desk')['toBlob'] != null)); - QV('DeskRecordButton', (deskState == 3) && (Q('Desk')['toBlob'] != null) && (desktop.m.StartRecording != null)); + QV('DeskSaveImageButton', (deskState == 3) && (Q('Desk')['toBlob'] != null) && ((features2 & 0x400) == 0)); + QV('DeskRecordButton', (deskState == 3) && (Q('Desk')['toBlob'] != null) && (desktop.m.StartRecording != null) && ((features2 & 0x400) == 0)); QV('DeskChatButton', ((rights & 16384) != 0) && (browserfullscreen == false) && (inputAllowed) && (currentNode.agent) && online); QV('DeskNotifyButton', ((rights & 16384) != 0) && (browserfullscreen == false) && (currentNode.agent) && (currentNode.agent.id < 5) && (inputAllowed) && (currentNode.agent) && online); QV('DeskLockButton', ((rights & 16384) != 0) && (browserfullscreen == false) && (currentNode.agent) && (currentNode.agent.id < 5) && (inputAllowed) && (currentNode.agent) && (deskState == 3)); diff --git a/webserver.js b/webserver.js index 668e865c..c57e8a3b 100644 --- a/webserver.js +++ b/webserver.js @@ -2694,6 +2694,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { if ((typeof domain.passwordrequirements != 'object') || (domain.passwordrequirements.logintokens != false)) { features2 += 0x00000080; } // Indicates login tokens are allowed if (req.session.loginToken != null) { features2 += 0x00000100; } // LoginToken mode, no account changes. if (domain.ssh == true) { features2 += 0x00000200; } // SSH is enabled + if (domain.localsessionrecording === false) { features2 += 0x00000400; } // Disable local recording feature // Create a authentication cookie const authCookie = obj.parent.encodeCookie({ userid: dbGetFunc.user._id, domainid: domain.id, ip: req.clientIp }, obj.parent.loginCookieEncryptionKey);