diff --git a/MeshCentralServer.njsproj b/MeshCentralServer.njsproj index c0919443..4b72e4a7 100644 --- a/MeshCentralServer.njsproj +++ b/MeshCentralServer.njsproj @@ -32,7 +32,6 @@ - diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index af973249..cad927b7 100644 Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ diff --git a/agents/MeshCmd64-signed.exe b/agents/MeshCmd64-signed.exe index 314aca84..0e7392b6 100644 Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ diff --git a/agents/MeshService-signed.exe b/agents/MeshService-signed.exe index 62f15e09..a04335e5 100644 Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ diff --git a/agents/MeshService64-signed.exe b/agents/MeshService64-signed.exe index 95a4b51d..f499154d 100644 Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ diff --git a/agents/modules_meshcmd/amt-xml.js b/agents/modules_meshcmd/amt-xml.js index 5890d742..3e98692a 100644 --- a/agents/modules_meshcmd/amt-xml.js +++ b/agents/modules_meshcmd/amt-xml.js @@ -121,65 +121,68 @@ function _getChildElementsByTagName(name) { var ret = []; if (this.childNodes != function _getChildElementsByTagNameNS(ns, name) { var ret = []; if (this.childNodes != null) { for (var node in this.childNodes) { if (this.childNodes[node].localName == name && (ns == '*' || this.childNodes[node].namespace == ns)) { ret.push(this.childNodes[node]); } } } return (ret); } function _xmlTraverseAllRec(nodes, func) { for (var i in nodes) { func(nodes[i]); if (nodes[i].childNodes) { _xmlTraverseAllRec(nodes[i].childNodes, func); } } } function _turnToXmlRec(text) { - var elementStack = new _treeBuilder(), lastElement = null, x1 = text.split('<'), ret = [], element = null, currentElementName = null; - for (var i in x1) { - var x2 = x1[i].split('>'), x3 = x2[0].split(' '), elementName = x3[0]; - if ((elementName.length > 0) && (elementName[0] != '?')) { - if (elementName[0] != '/') { - var attributes = [], localName, localname2 = elementName.split(' ')[0].split(':'), localName = (localname2.length > 1) ? localname2[1] : localname2[0]; - Object.defineProperty(attributes, "get", - { - value: function () { - if (arguments.length == 1) { - for (var a in this) { if (this[a].name == arguments[0]) { return (this[a]); } } - } - else if (arguments.length == 2) { - for (var a in this) { if (this[a].name == arguments[1] && (arguments[0] == '*' || this[a].namespace == arguments[0])) { return (this[a]); } } - } - else { - throw ('attributes.get(): Invalid number of parameters'); - } - } - }); - elementStack.push({ name: elementName, localName: localName, getChildElementsByTagName: _getChildElementsByTagName, getElementsByTagNameNS: _getElementsByTagNameNS, getChildElementsByTagNameNS: _getChildElementsByTagNameNS, attributes: attributes, childNodes: [], nsTable: {} }); - // Parse Attributes - if (x3.length > 0) { - var skip = false; - for (var j in x3) { - if (x3[j] == '/') { - // This is an empty Element - elementStack.peek().namespace = elementStack.peek().name == elementStack.peek().localName ? elementStack.getNamespace('*') : elementStack.getNamespace(elementStack.peek().name.substring(0, elementStack.peek().name.indexOf(':'))); - elementStack.peek().textContent = ''; - lastElement = elementStack.pop(); - skip = true; - break; - } - var k = x3[j].indexOf('='); - if (k > 0) { - var attrName = x3[j].substring(0, k); - var attrValue = x3[j].substring(k + 2, x3[j].length - 1); - var attrNS = elementStack.getNamespace('*'); - - if (attrName == 'xmlns') { - elementStack.addNamespace('*', attrValue); - attrNS = attrValue; - } else if (attrName.startsWith('xmlns:')) { - elementStack.addNamespace(attrName.substring(6), attrValue); - } else { - var ax = attrName.split(':'); - if (ax.length == 2) { attrName = ax[1]; attrNS = elementStack.getNamespace(ax[0]); } + try { + if (text == null) return null; + var elementStack = new _treeBuilder(), lastElement = null, x1 = text.split('<'), ret = [], element = null, currentElementName = null; + for (var i in x1) { + var x2 = x1[i].split('>'), x3 = x2[0].split(' '), elementName = x3[0]; + if ((elementName.length > 0) && (elementName[0] != '?')) { + if (elementName[0] != '/') { + var attributes = [], localName, localname2 = elementName.split(' ')[0].split(':'), localName = (localname2.length > 1) ? localname2[1] : localname2[0]; + Object.defineProperty(attributes, "get", + { + value: function () { + if (arguments.length == 1) { + for (var a in this) { if (this[a].name == arguments[0]) { return (this[a]); } } + } + else if (arguments.length == 2) { + for (var a in this) { if (this[a].name == arguments[1] && (arguments[0] == '*' || this[a].namespace == arguments[0])) { return (this[a]); } } + } + else { + throw ('attributes.get(): Invalid number of parameters'); + } + } + }); + elementStack.push({ name: elementName, localName: localName, getChildElementsByTagName: _getChildElementsByTagName, getElementsByTagNameNS: _getElementsByTagNameNS, getChildElementsByTagNameNS: _getChildElementsByTagNameNS, attributes: attributes, childNodes: [], nsTable: {} }); + // Parse Attributes + if (x3.length > 0) { + var skip = false; + for (var j in x3) { + if (x3[j] == '/') { + // This is an empty Element + elementStack.peek().namespace = elementStack.peek().name == elementStack.peek().localName ? elementStack.getNamespace('*') : elementStack.getNamespace(elementStack.peek().name.substring(0, elementStack.peek().name.indexOf(':'))); + elementStack.peek().textContent = ''; + lastElement = elementStack.pop(); + skip = true; + break; + } + var k = x3[j].indexOf('='); + if (k > 0) { + var attrName = x3[j].substring(0, k); + var attrValue = x3[j].substring(k + 2, x3[j].length - 1); + var attrNS = elementStack.getNamespace('*'); + + if (attrName == 'xmlns') { + elementStack.addNamespace('*', attrValue); + attrNS = attrValue; + } else if (attrName.startsWith('xmlns:')) { + elementStack.addNamespace(attrName.substring(6), attrValue); + } else { + var ax = attrName.split(':'); + if (ax.length == 2) { attrName = ax[1]; attrNS = elementStack.getNamespace(ax[0]); } + } + var x = { name: attrName, value: attrValue } + if (attrNS != null) x.namespace = attrNS; + elementStack.peek().attributes.push(x); } - var x = { name: attrName, value: attrValue } - if (attrNS != null) x.namespace = attrNS; - elementStack.peek().attributes.push(x); } + if (skip) { continue; } } - if (skip) { continue; } - } - elementStack.peek().namespace = elementStack.peek().name == elementStack.peek().localName ? elementStack.getNamespace('*') : elementStack.getNamespace(elementStack.peek().name.substring(0, elementStack.peek().name.indexOf(':'))); - if (x2[1]) { elementStack.peek().textContent = x2[1]; } - } else { lastElement = elementStack.pop(); } + elementStack.peek().namespace = elementStack.peek().name == elementStack.peek().localName ? elementStack.getNamespace('*') : elementStack.getNamespace(elementStack.peek().name.substring(0, elementStack.peek().name.indexOf(':'))); + if (x2[1]) { elementStack.peek().textContent = x2[1]; } + } else { lastElement = elementStack.pop(); } + } } - } + } catch (ex) { return null; } return lastElement; } diff --git a/agents/modules_meshcmd_min/amt-xml.min.js b/agents/modules_meshcmd_min/amt-xml.min.js index 821a1dd7..4b2308ed 100644 --- a/agents/modules_meshcmd_min/amt-xml.min.js +++ b/agents/modules_meshcmd_min/amt-xml.min.js @@ -1 +1 @@ -try{Object.defineProperty(Array.prototype,"peek",{value:function(){return(this.length>0?this[this.length-1]:undefined)}})}catch(e){}module.exports.ParseWsman=function(j){try{if(!j.childNodes){j=_turnToXml(j)}var g={Header:{}},d=j.getElementsByTagName("Header")[0],h;if(!d){d=j.getElementsByTagName("a:Header")[0]}if(!d){return null}for(var f=0;f0){h=a.childNodes[0].localName;if(h.indexOf("_OUTPUT")==h.length-7){h=h.substring(0,h.length-7)}g.Header.Method=h;g.Body=_ParseWsmanRec(a.childNodes[0])}return g}catch(c){console.error("Unable to parse XML: "+j,c);return null}};function _ParseWsmanRec(g){var c,h={};for(var d=0;d0)){b={Value:c};for(var f=0;f';for(var c in d){if(!d.hasOwnProperty(c)||c.indexOf("__")===0||c.indexOf("@")===0){continue}if(d[c]==null||typeof d[c]==="function"){continue}if(typeof d[c]==="object"&&d[c]["ReferenceParameters"]){f+=""+d[c].Address+""+d[c]["ReferenceParameters"]["ResourceURI"]+"";var h=d[c]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(h)){for(var a=0;a"+h[a]["Value"]+""}}else{f+=""+h.Value+""}f+=""}else{if(Array.isArray(d[c])){for(var a=0;a"+d[c][a].toString()+""}}else{f+=""+d[c].toString()+""}}}f+="";return f}function _treeBuilder(){this.tree=[];this.push=function(a){this.tree.push(a)};this.pop=function(){var a=this.tree.pop();if(this.tree.length>0){var b=this.tree.peek();b.childNodes.push(a);b.childElementCount=b.childNodes.length}return(a)};this.peek=function(){return(this.tree.peek())};this.addNamespace=function(g,d){this.tree.peek().nsTable[g]=d;if(this.tree.peek().attributes.length>0){for(var c=0;c=0;--a){if(this.tree[a].nsTable[b]!=null){return(this.tree[a].nsTable[b])}}return null}}function _turnToXml(a){if(a==null){return null}return({childNodes:[_turnToXmlRec(a)],getElementsByTagName:_getElementsByTagName,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS})}function _getElementsByTagNameNS(b,a){var c=[];_xmlTraverseAllRec(this.childNodes,function(d){if(d.localName==a&&(d.namespace==b||b=="*")){c.push(d)}});return c}function _getElementsByTagName(a){var b=[];_xmlTraverseAllRec(this.childNodes,function(c){if(c.localName==a){b.push(c)}});return b}function _getChildElementsByTagName(a){var c=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a){c.push(this.childNodes[b])}}}return(c)}function _getChildElementsByTagNameNS(c,a){var d=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a&&(c=="*"||this.childNodes[b].namespace==c)){d.push(this.childNodes[b])}}}return(d)}function _xmlTraverseAllRec(c,a){for(var b in c){a(c[b]);if(c[b].childNodes){_xmlTraverseAllRec(c[b].childNodes,a)}}}function _turnToXmlRec(v){var m=new _treeBuilder(),q=null,y=v.split("<"),t=[],h=null,g=null;for(var n in y){var z=y[n].split(">"),A=z[0].split(" "),l=A[0];if((l.length>0)&&(l[0]!="?")){if(l[0]!="/"){var a=[],r,s=l.split(" ")[0].split(":"),r=(s.length>1)?s[1]:s[0];Object.defineProperty(a,"get",{value:function(){if(arguments.length==1){for(var i in this){if(this[i].name==arguments[0]){return(this[i])}}}else{if(arguments.length==2){for(var i in this){if(this[i].name==arguments[1]&&(arguments[0]=="*"||this[i].namespace==arguments[0])){return(this[i])}}}else{throw ("attributes.get(): Invalid number of parameters")}}}});m.push({name:l,localName:r,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS,getChildElementsByTagNameNS:_getChildElementsByTagNameNS,attributes:a,childNodes:[],nsTable:{}});if(A.length>0){var u=false;for(var o in A){if(A[o]=="/"){m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));m.peek().textContent="";q=m.pop();u=true;break}var p=A[o].indexOf("=");if(p>0){var b=A[o].substring(0,p);var d=A[o].substring(p+2,A[o].length-1);var c=m.getNamespace("*");if(b=="xmlns"){m.addNamespace("*",d);c=d}else{if(b.startsWith("xmlns:")){m.addNamespace(b.substring(6),d)}else{var f=b.split(":");if(f.length==2){b=f[1];c=m.getNamespace(f[0])}}}var w={name:b,value:d};if(c!=null){w.namespace=c}m.peek().attributes.push(w)}}if(u){continue}}m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));if(z[1]){m.peek().textContent=z[1]}}else{q=m.pop()}}}return q}; \ No newline at end of file +try{Object.defineProperty(Array.prototype,"peek",{value:function(){return(this.length>0?this[this.length-1]:undefined)}})}catch(e){}module.exports.ParseWsman=function(j){try{if(!j.childNodes){j=_turnToXml(j)}var g={Header:{}},d=j.getElementsByTagName("Header")[0],h;if(!d){d=j.getElementsByTagName("a:Header")[0]}if(!d){return null}for(var f=0;f0){h=a.childNodes[0].localName;if(h.indexOf("_OUTPUT")==h.length-7){h=h.substring(0,h.length-7)}g.Header.Method=h;g.Body=_ParseWsmanRec(a.childNodes[0])}return g}catch(c){console.error("Unable to parse XML: "+j,c);return null}};function _ParseWsmanRec(g){var c,h={};for(var d=0;d0)){b={Value:c};for(var f=0;f';for(var c in d){if(!d.hasOwnProperty(c)||c.indexOf("__")===0||c.indexOf("@")===0){continue}if(d[c]==null||typeof d[c]==="function"){continue}if(typeof d[c]==="object"&&d[c]["ReferenceParameters"]){f+=""+d[c].Address+""+d[c]["ReferenceParameters"]["ResourceURI"]+"";var h=d[c]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(h)){for(var a=0;a"+h[a]["Value"]+""}}else{f+=""+h.Value+""}f+=""}else{if(Array.isArray(d[c])){for(var a=0;a"+d[c][a].toString()+""}}else{f+=""+d[c].toString()+""}}}f+="";return f}function _treeBuilder(){this.tree=[];this.push=function(a){this.tree.push(a)};this.pop=function(){var a=this.tree.pop();if(this.tree.length>0){var b=this.tree.peek();b.childNodes.push(a);b.childElementCount=b.childNodes.length}return(a)};this.peek=function(){return(this.tree.peek())};this.addNamespace=function(g,d){this.tree.peek().nsTable[g]=d;if(this.tree.peek().attributes.length>0){for(var c=0;c=0;--a){if(this.tree[a].nsTable[b]!=null){return(this.tree[a].nsTable[b])}}return null}}function _turnToXml(a){if(a==null){return null}return({childNodes:[_turnToXmlRec(a)],getElementsByTagName:_getElementsByTagName,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS})}function _getElementsByTagNameNS(b,a){var c=[];_xmlTraverseAllRec(this.childNodes,function(d){if(d.localName==a&&(d.namespace==b||b=="*")){c.push(d)}});return c}function _getElementsByTagName(a){var b=[];_xmlTraverseAllRec(this.childNodes,function(c){if(c.localName==a){b.push(c)}});return b}function _getChildElementsByTagName(a){var c=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a){c.push(this.childNodes[b])}}}return(c)}function _getChildElementsByTagNameNS(c,a){var d=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a&&(c=="*"||this.childNodes[b].namespace==c)){d.push(this.childNodes[b])}}}return(d)}function _xmlTraverseAllRec(c,a){for(var b in c){a(c[b]);if(c[b].childNodes){_xmlTraverseAllRec(c[b].childNodes,a)}}}function _turnToXmlRec(w){try{if(w==null){return null}var m=new _treeBuilder(),r=null,z=w.split("<"),u=[],h=null,g=null;for(var o in z){var A=z[o].split(">"),B=A[0].split(" "),l=B[0];if((l.length>0)&&(l[0]!="?")){if(l[0]!="/"){var a=[],s,t=l.split(" ")[0].split(":"),s=(t.length>1)?t[1]:t[0];Object.defineProperty(a,"get",{value:function(){if(arguments.length==1){for(var i in this){if(this[i].name==arguments[0]){return(this[i])}}}else{if(arguments.length==2){for(var i in this){if(this[i].name==arguments[1]&&(arguments[0]=="*"||this[i].namespace==arguments[0])){return(this[i])}}}else{throw ("attributes.get(): Invalid number of parameters")}}}});m.push({name:l,localName:s,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS,getChildElementsByTagNameNS:_getChildElementsByTagNameNS,attributes:a,childNodes:[],nsTable:{}});if(B.length>0){var v=false;for(var p in B){if(B[p]=="/"){m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));m.peek().textContent="";r=m.pop();v=true;break}var q=B[p].indexOf("=");if(q>0){var b=B[p].substring(0,q);var d=B[p].substring(q+2,B[p].length-1);var c=m.getNamespace("*");if(b=="xmlns"){m.addNamespace("*",d);c=d}else{if(b.startsWith("xmlns:")){m.addNamespace(b.substring(6),d)}else{var f=b.split(":");if(f.length==2){b=f[1];c=m.getNamespace(f[0])}}}var y={name:b,value:d};if(c!=null){y.namespace=c}m.peek().attributes.push(y)}}if(v){continue}}m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));if(A[1]){m.peek().textContent=A[1]}}else{r=m.pop()}}}}catch(n){return null}return r}; \ No newline at end of file diff --git a/agents/modules_meshcore/amt-xml.js b/agents/modules_meshcore/amt-xml.js index 5890d742..dbe2f80c 100644 --- a/agents/modules_meshcore/amt-xml.js +++ b/agents/modules_meshcore/amt-xml.js @@ -121,6 +121,7 @@ function _getChildElementsByTagName(name) { var ret = []; if (this.childNodes != function _getChildElementsByTagNameNS(ns, name) { var ret = []; if (this.childNodes != null) { for (var node in this.childNodes) { if (this.childNodes[node].localName == name && (ns == '*' || this.childNodes[node].namespace == ns)) { ret.push(this.childNodes[node]); } } } return (ret); } function _xmlTraverseAllRec(nodes, func) { for (var i in nodes) { func(nodes[i]); if (nodes[i].childNodes) { _xmlTraverseAllRec(nodes[i].childNodes, func); } } } function _turnToXmlRec(text) { + if (text == null) return null; var elementStack = new _treeBuilder(), lastElement = null, x1 = text.split('<'), ret = [], element = null, currentElementName = null; for (var i in x1) { var x2 = x1[i].split('>'), x3 = x2[0].split(' '), elementName = x3[0]; diff --git a/agents/modules_meshcore_min/amt-xml.min.js b/agents/modules_meshcore_min/amt-xml.min.js index 821a1dd7..c8fe1c88 100644 --- a/agents/modules_meshcore_min/amt-xml.min.js +++ b/agents/modules_meshcore_min/amt-xml.min.js @@ -1 +1 @@ -try{Object.defineProperty(Array.prototype,"peek",{value:function(){return(this.length>0?this[this.length-1]:undefined)}})}catch(e){}module.exports.ParseWsman=function(j){try{if(!j.childNodes){j=_turnToXml(j)}var g={Header:{}},d=j.getElementsByTagName("Header")[0],h;if(!d){d=j.getElementsByTagName("a:Header")[0]}if(!d){return null}for(var f=0;f0){h=a.childNodes[0].localName;if(h.indexOf("_OUTPUT")==h.length-7){h=h.substring(0,h.length-7)}g.Header.Method=h;g.Body=_ParseWsmanRec(a.childNodes[0])}return g}catch(c){console.error("Unable to parse XML: "+j,c);return null}};function _ParseWsmanRec(g){var c,h={};for(var d=0;d0)){b={Value:c};for(var f=0;f';for(var c in d){if(!d.hasOwnProperty(c)||c.indexOf("__")===0||c.indexOf("@")===0){continue}if(d[c]==null||typeof d[c]==="function"){continue}if(typeof d[c]==="object"&&d[c]["ReferenceParameters"]){f+=""+d[c].Address+""+d[c]["ReferenceParameters"]["ResourceURI"]+"";var h=d[c]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(h)){for(var a=0;a"+h[a]["Value"]+""}}else{f+=""+h.Value+""}f+=""}else{if(Array.isArray(d[c])){for(var a=0;a"+d[c][a].toString()+""}}else{f+=""+d[c].toString()+""}}}f+="";return f}function _treeBuilder(){this.tree=[];this.push=function(a){this.tree.push(a)};this.pop=function(){var a=this.tree.pop();if(this.tree.length>0){var b=this.tree.peek();b.childNodes.push(a);b.childElementCount=b.childNodes.length}return(a)};this.peek=function(){return(this.tree.peek())};this.addNamespace=function(g,d){this.tree.peek().nsTable[g]=d;if(this.tree.peek().attributes.length>0){for(var c=0;c=0;--a){if(this.tree[a].nsTable[b]!=null){return(this.tree[a].nsTable[b])}}return null}}function _turnToXml(a){if(a==null){return null}return({childNodes:[_turnToXmlRec(a)],getElementsByTagName:_getElementsByTagName,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS})}function _getElementsByTagNameNS(b,a){var c=[];_xmlTraverseAllRec(this.childNodes,function(d){if(d.localName==a&&(d.namespace==b||b=="*")){c.push(d)}});return c}function _getElementsByTagName(a){var b=[];_xmlTraverseAllRec(this.childNodes,function(c){if(c.localName==a){b.push(c)}});return b}function _getChildElementsByTagName(a){var c=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a){c.push(this.childNodes[b])}}}return(c)}function _getChildElementsByTagNameNS(c,a){var d=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a&&(c=="*"||this.childNodes[b].namespace==c)){d.push(this.childNodes[b])}}}return(d)}function _xmlTraverseAllRec(c,a){for(var b in c){a(c[b]);if(c[b].childNodes){_xmlTraverseAllRec(c[b].childNodes,a)}}}function _turnToXmlRec(v){var m=new _treeBuilder(),q=null,y=v.split("<"),t=[],h=null,g=null;for(var n in y){var z=y[n].split(">"),A=z[0].split(" "),l=A[0];if((l.length>0)&&(l[0]!="?")){if(l[0]!="/"){var a=[],r,s=l.split(" ")[0].split(":"),r=(s.length>1)?s[1]:s[0];Object.defineProperty(a,"get",{value:function(){if(arguments.length==1){for(var i in this){if(this[i].name==arguments[0]){return(this[i])}}}else{if(arguments.length==2){for(var i in this){if(this[i].name==arguments[1]&&(arguments[0]=="*"||this[i].namespace==arguments[0])){return(this[i])}}}else{throw ("attributes.get(): Invalid number of parameters")}}}});m.push({name:l,localName:r,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS,getChildElementsByTagNameNS:_getChildElementsByTagNameNS,attributes:a,childNodes:[],nsTable:{}});if(A.length>0){var u=false;for(var o in A){if(A[o]=="/"){m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));m.peek().textContent="";q=m.pop();u=true;break}var p=A[o].indexOf("=");if(p>0){var b=A[o].substring(0,p);var d=A[o].substring(p+2,A[o].length-1);var c=m.getNamespace("*");if(b=="xmlns"){m.addNamespace("*",d);c=d}else{if(b.startsWith("xmlns:")){m.addNamespace(b.substring(6),d)}else{var f=b.split(":");if(f.length==2){b=f[1];c=m.getNamespace(f[0])}}}var w={name:b,value:d};if(c!=null){w.namespace=c}m.peek().attributes.push(w)}}if(u){continue}}m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));if(z[1]){m.peek().textContent=z[1]}}else{q=m.pop()}}}return q}; \ No newline at end of file +try{Object.defineProperty(Array.prototype,"peek",{value:function(){return(this.length>0?this[this.length-1]:undefined)}})}catch(e){}module.exports.ParseWsman=function(j){try{if(!j.childNodes){j=_turnToXml(j)}var g={Header:{}},d=j.getElementsByTagName("Header")[0],h;if(!d){d=j.getElementsByTagName("a:Header")[0]}if(!d){return null}for(var f=0;f0){h=a.childNodes[0].localName;if(h.indexOf("_OUTPUT")==h.length-7){h=h.substring(0,h.length-7)}g.Header.Method=h;g.Body=_ParseWsmanRec(a.childNodes[0])}return g}catch(c){console.error("Unable to parse XML: "+j,c);return null}};function _ParseWsmanRec(g){var c,h={};for(var d=0;d0)){b={Value:c};for(var f=0;f';for(var c in d){if(!d.hasOwnProperty(c)||c.indexOf("__")===0||c.indexOf("@")===0){continue}if(d[c]==null||typeof d[c]==="function"){continue}if(typeof d[c]==="object"&&d[c]["ReferenceParameters"]){f+=""+d[c].Address+""+d[c]["ReferenceParameters"]["ResourceURI"]+"";var h=d[c]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(h)){for(var a=0;a"+h[a]["Value"]+""}}else{f+=""+h.Value+""}f+=""}else{if(Array.isArray(d[c])){for(var a=0;a"+d[c][a].toString()+""}}else{f+=""+d[c].toString()+""}}}f+="";return f}function _treeBuilder(){this.tree=[];this.push=function(a){this.tree.push(a)};this.pop=function(){var a=this.tree.pop();if(this.tree.length>0){var b=this.tree.peek();b.childNodes.push(a);b.childElementCount=b.childNodes.length}return(a)};this.peek=function(){return(this.tree.peek())};this.addNamespace=function(g,d){this.tree.peek().nsTable[g]=d;if(this.tree.peek().attributes.length>0){for(var c=0;c=0;--a){if(this.tree[a].nsTable[b]!=null){return(this.tree[a].nsTable[b])}}return null}}function _turnToXml(a){if(a==null){return null}return({childNodes:[_turnToXmlRec(a)],getElementsByTagName:_getElementsByTagName,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS})}function _getElementsByTagNameNS(b,a){var c=[];_xmlTraverseAllRec(this.childNodes,function(d){if(d.localName==a&&(d.namespace==b||b=="*")){c.push(d)}});return c}function _getElementsByTagName(a){var b=[];_xmlTraverseAllRec(this.childNodes,function(c){if(c.localName==a){b.push(c)}});return b}function _getChildElementsByTagName(a){var c=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a){c.push(this.childNodes[b])}}}return(c)}function _getChildElementsByTagNameNS(c,a){var d=[];if(this.childNodes!=null){for(var b in this.childNodes){if(this.childNodes[b].localName==a&&(c=="*"||this.childNodes[b].namespace==c)){d.push(this.childNodes[b])}}}return(d)}function _xmlTraverseAllRec(c,a){for(var b in c){a(c[b]);if(c[b].childNodes){_xmlTraverseAllRec(c[b].childNodes,a)}}}function _turnToXmlRec(v){if(v==null){return null}var m=new _treeBuilder(),q=null,y=v.split("<"),t=[],h=null,g=null;for(var n in y){var z=y[n].split(">"),A=z[0].split(" "),l=A[0];if((l.length>0)&&(l[0]!="?")){if(l[0]!="/"){var a=[],r,s=l.split(" ")[0].split(":"),r=(s.length>1)?s[1]:s[0];Object.defineProperty(a,"get",{value:function(){if(arguments.length==1){for(var i in this){if(this[i].name==arguments[0]){return(this[i])}}}else{if(arguments.length==2){for(var i in this){if(this[i].name==arguments[1]&&(arguments[0]=="*"||this[i].namespace==arguments[0])){return(this[i])}}}else{throw ("attributes.get(): Invalid number of parameters")}}}});m.push({name:l,localName:r,getChildElementsByTagName:_getChildElementsByTagName,getElementsByTagNameNS:_getElementsByTagNameNS,getChildElementsByTagNameNS:_getChildElementsByTagNameNS,attributes:a,childNodes:[],nsTable:{}});if(A.length>0){var u=false;for(var o in A){if(A[o]=="/"){m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));m.peek().textContent="";q=m.pop();u=true;break}var p=A[o].indexOf("=");if(p>0){var b=A[o].substring(0,p);var d=A[o].substring(p+2,A[o].length-1);var c=m.getNamespace("*");if(b=="xmlns"){m.addNamespace("*",d);c=d}else{if(b.startsWith("xmlns:")){m.addNamespace(b.substring(6),d)}else{var f=b.split(":");if(f.length==2){b=f[1];c=m.getNamespace(f[0])}}}var w={name:b,value:d};if(c!=null){w.namespace=c}m.peek().attributes.push(w)}}if(u){continue}}m.peek().namespace=m.peek().name==m.peek().localName?m.getNamespace("*"):m.getNamespace(m.peek().name.substring(0,m.peek().name.indexOf(":")));if(z[1]){m.peek().textContent=z[1]}}else{q=m.pop()}}}return q}; \ No newline at end of file diff --git a/meshcentral.js b/meshcentral.js index 0478bfda..4a9c1ca6 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -1649,8 +1649,7 @@ function InstallModule(modulename, func, tag1, tag2) { InstallModuleChildProcess = child_process.exec('npm install --no-optional --save ' + modulename, { maxBuffer: 512000, timeout: 10000 }, function (error, stdout, stderr) { InstallModuleChildProcess = null; if (error != null) { - console.log('ERROR: Unable to install missing package \'' + modulename + '\', make sure npm is installed: ' + error); - console.log(stdout); + console.log('ERROR: Unable to install required module "' + modulename + '". MeshCentral may not have access to npm, or npm may not have suffisent rights to load the new module. Try "npm install ' + modulename + '" to manualy install this module.\r\n'); process.exit(); return; } diff --git a/package.json b/package.json index 52db858a..151508ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.3.1-p", + "version": "0.3.1-q", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/images/hardware-keypress-120 - Copy.png b/public/images/hardware-keypress-120 - Copy.png deleted file mode 100644 index c1d804b1..00000000 Binary files a/public/images/hardware-keypress-120 - Copy.png and /dev/null differ diff --git a/public/images/hardware-keypress-120.png b/public/images/hardware-keypress-120.png index bec0f394..8abd7456 100644 Binary files a/public/images/hardware-keypress-120.png and b/public/images/hardware-keypress-120.png differ diff --git a/views/default-min.handlebars b/views/default-min.handlebars index 85bbc35d..dad819cd 100644 --- a/views/default-min.handlebars +++ b/views/default-min.handlebars @@ -1 +1 @@ - MeshCentral Information Desktop Terminal Files Events Console Multi-Desktop Select All Select None Multi-Desktop {{{title}}} {{{title2}}} 0 {{{logoutControl}}} ↔ My Devices My Account My Events My Files My Users My Server General Desktop Terminal Files Events Intel® AMT Console General General Events General Stats Console Server disconnected, click to reconnect. My Devices OS Name Auto View Columns List Desktops Map Sort Group Power Device Tags Size Small Medium Large To get started, click here to create a device group. X Location Results My Account Account security ✓Manage authenticator app ✓Manage security keys ✓Manage backup codes Account actions Verify email Change email address Change password Delete account Device Groups ( New ) No device groups. Get started here! My Events Show Last 60 Last 120 Last 250 Last 500 Last 1000 My Users My Files Sort by name Sort by size Sort by date Descend by name Descend by size Descend by date These files are shared publicly, click "link" to get public url. ✓ ✗ My Server Server actions Download server backup Restore server with backup Check server version Show server error log Server Statistics General - Desktop - Intel® AMT Redirection port or KVM feature is disabled, click here to enable it. Remote computer is not powered on, click here to issue a power command. ↺ ↻ ✖ Disconnected Refresh Processes PIDName Win Win+Down Win+Up Win+L Win+M Shift+Win+M Win+R Input Terminal - Intel® AMT Redirection port or KVM feature is disabled, click here to enable it. Remote computer is not powered on, click here to issue a power command. Disconnected Files - Disconnected Sort by name Sort by size Sort by date Descend by name Descend by size Descend by date ✓ ✗ Intel® AMT - Events - Show Last 60 Last 120 Last 250 Last 500 Last 1000 General - General - Events - Show Last 60 Last 120 Last 250 Last 500 Last 1000 My Server Stats Connections Memory Last 3 hours Last 8 hours Last day Last week Last 30 days Log-X ✖ Local file upload Server file selection File Selection Upload File Agent Remote Desktop Quality 100% 87.5% 75% 62.5% 50% 37.5% 25% 12.5% Scaling Fast Medium Slow Very slow Frame rate Intel® AMT Hardware KVM RLE8, Fastest RLE16, Recommended RAW8, Slow RAW16, Very Slow Image Encoding Show Focus Tool Show Local Mouse Cursor Local Keyboard Map Other Settings \ No newline at end of file + MeshCentral Information Desktop Terminal Files Events Console Multi-Desktop Select All Select None Multi-Desktop {{{title}}} {{{title2}}} 0 {{{logoutControl}}} ↔ My Devices My Account My Events My Files My Users My Server General Desktop Terminal Files Events Intel® AMT Console General General Events General Stats Console Server disconnected, click to reconnect. My Devices OS Name Auto View Columns List Desktops Map Sort Group Power Device Tags Size Small Medium Large To get started, click here to create a device group. X Location Results My Account Account security ✓Manage authenticator app ✓Manage security keys ✓Manage backup codes Account actions Verify email Change email address Change password Delete account Device Groups ( New ) No device groups. Get started here! My Events Show Last 60 Last 120 Last 250 Last 500 Last 1000 My Users My Files Sort by name Sort by size Sort by date Descend by name Descend by size Descend by date These files are shared publicly, click "link" to get public url. ✓ ✗ My Server Server actions Download server backup Restore server with backup Check server version Show server error log Server Statistics General - Desktop - Intel® AMT Redirection port or KVM feature is disabled, click here to enable it. Remote computer is not powered on, click here to issue a power command. ↺ ↻ ✖ Disconnected Refresh Processes PIDName Win Win+Down Win+Up Win+L Win+M Shift+Win+M Win+R Input Terminal - Intel® AMT Redirection port or KVM feature is disabled, click here to enable it. Remote computer is not powered on, click here to issue a power command. Disconnected Files - Disconnected Sort by name Sort by size Sort by date Descend by name Descend by size Descend by date ✓ ✗ Intel® AMT - Events - Show Last 60 Last 120 Last 250 Last 500 Last 1000 General - General - Events - Show Last 60 Last 120 Last 250 Last 500 Last 1000 My Server Stats Connections Memory Last 3 hours Last 8 hours Last day Last week Last 30 days Log-X ✖ Local file upload Server file selection File Selection Upload File Agent Remote Desktop Quality 100% 87.5% 75% 62.5% 50% 37.5% 25% 12.5% Scaling Fast Medium Slow Very slow Frame rate Intel® AMT Hardware KVM RLE8, Fastest RLE16, Recommended RAW8, Slow RAW16, Very Slow Image Encoding Show Focus Tool Show Local Mouse Cursor Local Keyboard Map Other Settings \ No newline at end of file diff --git a/views/default.handlebars b/views/default.handlebars index 02eddbab..aba9f89f 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -1549,8 +1549,10 @@ meshserver.send({ action: 'otp-hkey-setup-response', response: registrationResponse, name: Q('dp1keyname').value }); setDialogMode(2, "Add Security Key", 0, null, 'Checking...', 'otpauth-hardware-manage'); } else { - var errorCodes = ['', 'Unknown error', 'Bad request', 'Unsupported configuration', 'This key was already registered', 'Timeout']; - setDialogMode(2, "Add Security Key", 1, null, '' + errorCodes[registrationResponse.errorCode] + '.'); + if (xxdialogMode && (xxdialogTag != 'otpauth-hardware-manage')) { + var errorCodes = ['', 'Unknown error', 'Bad request', 'Unsupported configuration', 'This key was already registered', 'Timeout']; + setDialogMode(2, "Add Security Key", 1, null, '' + errorCodes[registrationResponse.errorCode] + '.'); + } } }, message.request.timeoutSeconds); break;
{{{logoutControl}}}
Account security
Account actions
Verify email Change email address Change password Delete account
Server actions