diff --git a/agents/meshcore.js b/agents/meshcore.js index 254ac9e1..a228904b 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1158,6 +1158,7 @@ function handleServerCommand(data) { tunnel.soptions = data.soptions; tunnel.consentTimeout = (tunnel.soptions && tunnel.soptions.consentTimeout) ? tunnel.soptions.consentTimeout : 30; tunnel.consentAutoAccept = (tunnel.soptions && (tunnel.soptions.consentAutoAccept === true)); + tunnel.oldStyle = (tunnel.soptions && tunnel.soptions.oldStyle) ? tunnel.soptions.oldStyle : false; tunnel.tcpaddr = data.tcpaddr; tunnel.tcpport = data.tcpport; tunnel.udpaddr = data.udpaddr; @@ -2836,7 +2837,9 @@ function onTunnelData(data) if (process.platform == 'win32') { var enhanced = false; - try { require('win-userconsent'); enhanced = true; } catch (ex) { } + if (this.httprequest.oldStyle === false) { + try { require('win-userconsent'); enhanced = true; } catch (ex) { } + } if (enhanced) { var ipr = server_getUserImage(this.httprequest.userid); @@ -3000,7 +3003,9 @@ function onTunnelData(data) if (process.platform == 'win32') { var enhanced = false; - try { require('win-userconsent'); enhanced = true; } catch (ex) { } + if (this.httprequest.oldStyle === false) { + try { require('win-userconsent'); enhanced = true; } catch (ex) { } + } if (enhanced) { var ipr = server_getUserImage(this.httprequest.userid); @@ -3153,7 +3158,9 @@ function onTunnelData(data) if (process.platform == 'win32') { var enhanced = false; - try { require('win-userconsent'); enhanced = true; } catch (ex) { } + if (this.httprequest.oldStyle === false) { + try { require('win-userconsent'); enhanced = true; } catch (ex) { } + } if (enhanced) { var ipr = server_getUserImage(this.httprequest.userid); diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 97f51580..b1b1a772 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -1870,6 +1870,11 @@ "type": "boolean", "default": false, "description": "If true, user consent is accepted after the timeout." + }, + "oldStyle": { + "type": "boolean", + "default": false, + "description": "If true, user consent will be shown in an old style prompt box rather than the new style consent-box." } } }, diff --git a/meshdesktopmultiplex.js b/meshdesktopmultiplex.js index b7888f9a..3a14540a 100644 --- a/meshdesktopmultiplex.js +++ b/meshdesktopmultiplex.js @@ -1347,6 +1347,7 @@ function CreateMeshRelayEx2(parent, ws, req, domain, user, cookie) { if (typeof domain.consentmessages.files == 'string') { command.soptions.consentMsgFiles = domain.consentmessages.files; } if ((typeof domain.consentmessages.consenttimeout == 'number') && (domain.consentmessages.consenttimeout > 0)) { command.soptions.consentTimeout = domain.consentmessages.consenttimeout; } if (domain.consentmessages.autoacceptontimeout === true) { command.soptions.consentAutoAccept = true; } + if (domain.consentmessages.oldstyle === true) { command.soptions.oldStyle = true; } } if (typeof domain.notificationmessages == 'object') { if (typeof domain.notificationmessages.title == 'string') { command.soptions.notifyTitle = domain.notificationmessages.title; } diff --git a/meshrelay.js b/meshrelay.js index 5164fdf4..d1d9fe06 100644 --- a/meshrelay.js +++ b/meshrelay.js @@ -893,6 +893,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) { if (typeof domain.consentmessages.files == 'string') { command.soptions.consentMsgFiles = domain.consentmessages.files; } if ((typeof domain.consentmessages.consenttimeout == 'number') && (domain.consentmessages.consenttimeout > 0)) { command.soptions.consentTimeout = domain.consentmessages.consenttimeout; } if (domain.consentmessages.autoacceptontimeout === true) { command.soptions.consentAutoAccept = true; } + if (domain.consentmessages.oldstyle === true) { command.soptions.oldStyle = true; } } if (typeof domain.notificationmessages == 'object') { if (typeof domain.notificationmessages.title == 'string') { command.soptions.notifyTitle = domain.notificationmessages.title; } @@ -930,6 +931,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) { if (typeof domain.consentmessages.files == 'string') { command.soptions.consentMsgFiles = domain.consentmessages.files; } if ((typeof domain.consentmessages.consenttimeout == 'number') && (domain.consentmessages.consenttimeout > 0)) { command.soptions.consentTimeout = domain.consentmessages.consenttimeout; } if (domain.consentmessages.autoacceptontimeout === true) { command.soptions.consentAutoAccept = true; } + if (domain.consentmessages.oldstyle === true) { command.soptions.oldStyle = true; } } if (typeof domain.notificationmessages == 'object') { if (typeof domain.notificationmessages.title == 'string') { command.soptions.notifyTitle = domain.notificationmessages.title; } @@ -948,6 +950,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) { if (typeof domain.consentmessages.files == 'string') { command.soptions.consentMsgFiles = domain.consentmessages.files; } if ((typeof domain.consentmessages.consenttimeout == 'number') && (domain.consentmessages.consenttimeout > 0)) { command.soptions.consentTimeout = domain.consentmessages.consenttimeout; } if (domain.consentmessages.autoacceptontimeout === true) { command.soptions.consentAutoAccept = true; } + if (domain.consentmessages.oldstyle === true) { command.soptions.oldStyle = true; } } if (typeof domain.notificationmessages == 'object') { if (typeof domain.notificationmessages.title == 'string') { command.soptions.notifyTitle = domain.notificationmessages.title; } @@ -999,6 +1002,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) { if (typeof domain.consentmessages.files == 'string') { command.soptions.consentMsgFiles = domain.consentmessages.files; } if ((typeof domain.consentmessages.consenttimeout == 'number') && (domain.consentmessages.consenttimeout > 0)) { command.soptions.consentTimeout = domain.consentmessages.consenttimeout; } if (domain.consentmessages.autoacceptontimeout === true) { command.soptions.consentAutoAccept = true; } + if (domain.consentmessages.oldstyle === true) { command.soptions.oldStyle = true; } } if (typeof domain.notificationmessages == 'object') { if (typeof domain.notificationmessages.title == 'string') { command.soptions.notifyTitle = domain.notificationmessages.title; } diff --git a/meshuser.js b/meshuser.js index 01e45e86..947c0538 100644 --- a/meshuser.js +++ b/meshuser.js @@ -997,6 +997,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (typeof domain.consentmessages.files == 'string') { command.soptions.consentMsgFiles = domain.consentmessages.files; } if ((typeof domain.consentmessages.consenttimeout == 'number') && (domain.consentmessages.consenttimeout > 0)) { command.soptions.consentTimeout = domain.consentmessages.consenttimeout; } if (domain.consentmessages.autoacceptontimeout === true) { command.soptions.consentAutoAccept = true; } + if (domain.consentmessages.oldstyle === true) { command.soptions.oldStyle = true; } } if (typeof domain.notificationmessages == 'object') { if (typeof domain.notificationmessages.title == 'string') { command.soptions.notifyTitle = domain.notificationmessages.title; } diff --git a/sample-config-advanced.json b/sample-config-advanced.json index c3712a93..279e02aa 100644 --- a/sample-config-advanced.json +++ b/sample-config-advanced.json @@ -338,7 +338,8 @@ "terminal": "{0} requesting remote terminal access. Grant access?", "files": "{0} requesting remote files access. Grant access?", "consentTimeout": 30, - "autoAcceptOnTimeout": false + "autoAcceptOnTimeout": false, + "oldStyle": true }, "_notificationMessages": { "title": "MeshCentral",