From bfffdfd8f4244d1be9433feb94f32773539bf880 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sat, 13 Mar 2021 22:28:12 -0800 Subject: [PATCH] WebUI now displays AMT bare-metal option only on correct device group. --- amtprovisioningserver.js | 1 + meshuser.js | 1 + views/default.handlebars | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/amtprovisioningserver.js b/amtprovisioningserver.js index e1ac7130..55927a4d 100644 --- a/amtprovisioningserver.js +++ b/amtprovisioningserver.js @@ -19,6 +19,7 @@ // In Intel documentation, this is called the Setup and Configuration Application (SCA) module.exports.CreateAmtProvisioningServer = function (parent, config) { var obj = {}; + obj.meshid = config.devicegroup; // This is the device group identifier that all activated devices will be added to. // WSMAN stack const CreateWsmanComm = require('./amt/amt-wsman-comm'); diff --git a/meshuser.js b/meshuser.js index 4a9d0806..a8bd4377 100644 --- a/meshuser.js +++ b/meshuser.js @@ -465,6 +465,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use serverinfo.https = true; serverinfo.redirport = args.redirport; if (parent.parent.webpush != null) { serverinfo.vapidpublickey = parent.parent.webpush.vapidPublicKey; } // Web push public key + if (parent.parent.amtProvisioningServer != null) { serverinfo.amtProvServerMeshId = parent.parent.amtProvisioningServer.meshid; } // Device group that allows for bare-metal Intel AMT activation // Build the mobile agent URL, this is used to connect mobile devices var agentServerName = parent.getWebServerName(domain); diff --git a/views/default.handlebars b/views/default.handlebars index 5b4cc232..b8f94848 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -4267,7 +4267,7 @@ x += addHtmlValue("Old Password", ''); x += addHtmlValue("New Password*", ''); x += addHtmlValue("New Password*", ''); - if (features2 & 0x00000020) { x += ''; } // Intel AMT LAN provisioning server is active. + if ((features2 & 0x00000020) && (currentMesh.mtype == 1) && (serverinfo.amtProvServerMeshId == currentMesh._id)) { x += ''; } // Intel AMT LAN provisioning server is active. x += '
' + "* 8 characters, 1 upper, 1 lower, 1 numeric, 1 non-alpha numeric." + '
'; setDialogMode(2, "Intel® AMT ACM", 3, showAmtAcmSetupEx, x); Q('dp1password0').focus();