WebUI now displays AMT bare-metal option only on correct device group.

Ylian Saint-Hilaire committed Mar 13, 2021 at 22:28 UTC bfffdfd8f4244d1be9433feb94f32773539bf880
3 files changed +3 -1
amtprovisioningserver.js
+1
@@ -19,6 +19,7 @@
19 // In Intel documentation, this is called the Setup and Configuration Application (SCA)
20 module.exports.CreateAmtProvisioningServer = function (parent, config) {
21 var obj = {};
22 + obj.meshid = config.devicegroup; // This is the device group identifier that all activated devices will be added to.
23
24 // WSMAN stack
25 const CreateWsmanComm = require('./amt/amt-wsman-comm');
meshuser.js
+1
@@ -465,6 +465,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
465 serverinfo.https = true;
466 serverinfo.redirport = args.redirport;
467 if (parent.parent.webpush != null) { serverinfo.vapidpublickey = parent.parent.webpush.vapidPublicKey; } // Web push public key
468 + if (parent.parent.amtProvisioningServer != null) { serverinfo.amtProvServerMeshId = parent.parent.amtProvisioningServer.meshid; } // Device group that allows for bare-metal Intel AMT activation
469
470 // Build the mobile agent URL, this is used to connect mobile devices
471 var agentServerName = parent.getWebServerName(domain);
views/default.handlebars
+1 -1
@@ -4267,7 +4267,7 @@
4267 x += addHtmlValue("Old Password", '<input id=dp1password0 type=password style=width:230px autocomplete=off maxlength=32 onchange=validateAmtAcmSetupEx() onkeyup=validateAmtAcmSetupEx() />');
4268 x += addHtmlValue("New Password*", '<input id=dp1password1 type=password style=width:230px autocomplete=off maxlength=32 onchange=validateAmtAcmSetupEx() onkeyup=validateAmtAcmSetupEx() />');
4269 x += addHtmlValue("New Password*", '<input id=dp1password2 type=password style=width:230px autocomplete=off maxlength=32 onchange=validateAmtAcmSetupEx() onkeyup=validateAmtAcmSetupEx() />');
4270 - if (features2 & 0x00000020) { x += '<label><input id=dp1lanprov type=checkbox /> ' + "Use for bare-metal LAN activation." + '</label>'; } // Intel AMT LAN provisioning server is active.
4270 + if ((features2 & 0x00000020) && (currentMesh.mtype == 1) && (serverinfo.amtProvServerMeshId == currentMesh._id)) { x += '<label><input id=dp1lanprov type=checkbox /> ' + "Use for bare-metal LAN activation." + '</label>'; } // Intel AMT LAN provisioning server is active.
4271 x += '<div><span id=dp10passNotify style="font-size:10px"> ' + "* 8 characters, 1 upper, 1 lower, 1 numeric, 1 non-alpha numeric." + '</span></div>';
4272 setDialogMode(2, "Intel&reg; AMT ACM", 3, showAmtAcmSetupEx, x);
4273 Q('dp1password0').focus();