diff --git a/db.js b/db.js index 022a76be..b797a15f 100644 --- a/db.js +++ b/db.js @@ -1535,7 +1535,7 @@ module.exports.CreateDB = function (parent, func) { obj.SetUser = function (user) { if (user == null) return; if (user.subscriptions != null) { var u = Clone(user); if (u.subscriptions) { delete u.subscriptions; } obj.Set(u); } else { obj.Set(user); } }; obj.dispose = function () { for (var x in obj) { if (obj[x].close) { obj[x].close(); } delete obj[x]; } }; obj.getLocalAmtNodes = function (func) { - sqlDbQuery('SELECT doc FROM main WHERE (type = \'node\') AND (extraex IS NOT NULL)', null, function (err, docs) { + sqlDbQuery('SELECT doc FROM main WHERE (type = \'node\') AND (extraex IS NULL)', null, function (err, docs) { if (docs != null) { for (var i in docs) { if (docs[i].links != null) { docs[i] = common.unEscapeLinksFieldName(docs[i]); } } } var r = []; if (err == null) { for (var i in docs) { if (docs[i].host != null) { r.push(docs[i]); } } } func(err, r); }); @@ -2091,7 +2091,7 @@ module.exports.CreateDB = function (parent, func) { obj.DeleteDomain = function (domain, func) { sqlDbQuery('DELETE FROM main WHERE domain = $1', [domain], func); }; obj.SetUser = function (user) { if (user == null) return; if (user.subscriptions != null) { var u = Clone(user); if (u.subscriptions) { delete u.subscriptions; } obj.Set(u); } else { obj.Set(user); } }; obj.dispose = function () { for (var x in obj) { if (obj[x].close) { obj[x].close(); } delete obj[x]; } }; - obj.getLocalAmtNodes = function (func) { sqlDbQuery('SELECT doc FROM main WHERE (type = \'node\') AND (extraex IS NOT NULL)', null, function (err, docs) { var r = []; if (err == null) { for (var i in docs) { if (docs[i].host != null) { r.push(docs[i]); } } } func(err, r); }); }; + obj.getLocalAmtNodes = function (func) { sqlDbQuery('SELECT doc FROM main WHERE (type = \'node\') AND (extraex IS NULL)', null, function (err, docs) { var r = []; if (err == null) { for (var i in docs) { if (docs[i].host != null) { r.push(docs[i]); } } } func(err, r); }); }; obj.getAmtUuidMeshNode = function (domainid, mtype, uuid, func) { sqlDbQuery('SELECT doc FROM main WHERE domain = $1 AND extraex = $2', [domainid, 'uuid/' + uuid], func); }; obj.isMaxType = function (max, type, domainid, func) { if (max == null) { func(false); } else { sqlDbExec('SELECT COUNT(id) FROM main WHERE domain = $1 AND type = $2', [domainid, type], function (err, response) { func((response['COUNT(id)'] == null) || (response['COUNT(id)'] > max), response['COUNT(id)']) }); } } @@ -2351,7 +2351,7 @@ module.exports.CreateDB = function (parent, func) { obj.DeleteDomain = function (domain, func) { sqlDbQuery('DELETE FROM main WHERE domain = ?', [domain], func); }; obj.SetUser = function (user) { if (user == null) return; if (user.subscriptions != null) { var u = Clone(user); if (u.subscriptions) { delete u.subscriptions; } obj.Set(u); } else { obj.Set(user); } }; obj.dispose = function () { for (var x in obj) { if (obj[x].close) { obj[x].close(); } delete obj[x]; } }; - obj.getLocalAmtNodes = function (func) { sqlDbQuery('SELECT doc FROM main WHERE (type = "node") AND (extraex IS NOT NULL)', null, function (err, docs) { var r = []; if (err == null) { for (var i in docs) { if (docs[i].host != null) { r.push(docs[i]); } } } func(err, r); }); }; + obj.getLocalAmtNodes = function (func) { sqlDbQuery('SELECT doc FROM main WHERE (type = "node") AND (extraex IS NULL)', null, function (err, docs) { var r = []; if (err == null) { for (var i in docs) { if (docs[i].host != null) { r.push(docs[i]); } } } func(err, r); }); }; obj.getAmtUuidMeshNode = function (domainid, mtype, uuid, func) { sqlDbQuery('SELECT doc FROM main WHERE domain = ? AND extraex = ?', [domainid, 'uuid/' + uuid], func); }; obj.isMaxType = function (max, type, domainid, func) { if (max == null) { func(false); } else { sqlDbExec('SELECT COUNT(id) FROM main WHERE domain = ? AND type = ?', [domainid, type], function (err, response) { func((response['COUNT(id)'] == null) || (response['COUNT(id)'] > max), response['COUNT(id)']) }); } } diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index f173c37e..035dae66 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -2225,12 +2225,12 @@ "TlsConnections": { "type": "boolean", "default": true, - "description": "When set to false, MeshCentral will use TLS to connect to Intel AMT, this is not recommended." + "description": "When set to false, MeshCentral will NOT use TLS to connect to Intel AMT, this is not recommended." }, "TlsAcmActivation": { "type": "boolean", "default": false, - "description": "When set to false, MeshCentral will not attempt a TLS ACM activation on Intel AMT v14+" + "description": "When set to true, MeshCentral will attempt a TLS ACM activation on Intel AMT v14+" }, "AdminAccounts": { "description": "List of username and passwords to try when connecting to Intel AMT.", diff --git a/views/default.handlebars b/views/default.handlebars index d8a12e46..9aea63bf 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -13700,7 +13700,7 @@ p20editMeshAmtChange(); // Set the current Intel AMT policy - if (currentMesh.amt && (currentMesh.amt.type == 2) || (currentMesh.amt.type == 3)) { + if (currentMesh.amt && ((currentMesh.amt.type == 2) || (currentMesh.amt.type == 3))) { Q('dp20amtpolicypass').value = currentMesh.amt.password; if ((currentMesh.amt.type == 2) || (currentMesh.amt.type == 3)) { if (currentMesh.amt.badpass != null) { Q('dp20amtbadpass').value = currentMesh.amt.badpass; }