diff --git a/MeshCentralServer.njsproj b/MeshCentralServer.njsproj index 2796c9b5..1d2f0a8f 100644 --- a/MeshCentralServer.njsproj +++ b/MeshCentralServer.njsproj @@ -621,11 +621,14 @@ + + + @@ -635,11 +638,14 @@ + + + diff --git a/meshcentral.js b/meshcentral.js index fbfce414..c6a3e8cd 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -2695,7 +2695,7 @@ function CreateMeshCentralServer(config, args) { // Decode a cookie back into an object using a key using AES256-GCM or AES128-CBC/HMAC-SHA384. Return null if it's not a valid cookie. (key must be 32 bytes or more) obj.decodeCookie = function (cookie, key, timeout) { - if ((cookie == null) || (key == null)) return null; + if (cookie == null) return null; var r = obj.decodeCookieAESGCM(cookie, key, timeout); if (r == null) { r = obj.decodeCookieAESSHA(cookie, key, timeout); } if ((r == null) && (obj.args.cookieencoding == null) && (cookie.length != 64) && ((cookie == cookie.toLowerCase()) || (cookie == cookie.toUpperCase()))) { @@ -3126,7 +3126,10 @@ function mainStart() { if (config.settings.desktopmultiplex === true) { modules.push('image-size'); } // SMS support - if ((config.sms != null) && (config.sms.provider == 'twilio')) { modules.push('twilio'); } + if ((config.sms != null) && (config.sms.provider == 'twilio')) { + const NodeJSVer = Number(process.version.match(/^v(\d+\.\d+)/)[1]); + if (NodeJSVer < 8) { console.log("SMS Twilio support requires Node v8 or above, current version is " + process.version + "."); } else { modules.push('twilio'); } + } if ((config.sms != null) && (config.sms.provider == 'plivo')) { const NodeJSVer = Number(process.version.match(/^v(\d+\.\d+)/)[1]); if (NodeJSVer < 8) { console.log("SMS Plivo support requires Node v8 or above, current version is " + process.version + "."); } else { modules.push('plivo'); } diff --git a/meshuser.js b/meshuser.js index 4735d4d9..48de10b5 100644 --- a/meshuser.js +++ b/meshuser.js @@ -2700,10 +2700,12 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (command.resetNextLogin === true) { chguser.passchange = -1; } else { chguser.passchange = Math.floor(Date.now() / 1000); } delete chguser.passtype; // Remove the password type if one was present. if (command.removeMultiFactor == true) { - if (chguser.otpekey) { delete chguser.otpekey; } - if (chguser.otpsecret) { delete chguser.otpsecret; } - if (chguser.otphkeys) { delete chguser.otphkeys; } - if (chguser.otpkeys) { delete chguser.otpkeys; } + if (chguser.otpekey != null) { delete chguser.otpekey; } + if (chguser.otpsecret != null) { delete chguser.otpsecret; } + if (chguser.otphkeys != null) { delete chguser.otphkeys; } + if (chguser.otpkeys != null) { delete chguser.otpkeys; } + if ((chguser.otpekey != null) && (((typeof domain.passwordrequirements != 'object') || (domain.passwordrequirements.email2factor != false)) && (domain.mailserver != null))) { delete chguser.otpekey; } + if ((chguser.phone != null) && (parent.parent.smsserver != null)) { delete chguser.phone; } } db.SetUser(chguser); diff --git a/package.json b/package.json index 1e2e355d..c6cface7 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,9 @@ "sample-config-advanced.json" ], "dependencies": { + "@sendgrid/mail": "^7.4.2", + "archiver": "^4.0.2", + "archiver-zip-encrypted": "^1.0.8", "body-parser": "^1.19.0", "cbor": "~5.2.0", "compression": "^1.7.4", @@ -44,14 +47,23 @@ "express": "^4.17.0", "express-handlebars": "^3.1.0", "express-ws": "^4.0.0", + "image-size": "^0.9.3", "ipcheck": "^0.1.0", "minimist": "^1.2.0", + "mongodb": "^3.6.4", "multiparty": "^4.2.1", "nedb": "^1.8.0", "node-forge": "^0.10.0", + "node-rdpjs-2": "^0.3.5", + "node-windows": "^0.1.14", + "otplib": "^10.2.3", + "saslprep": "^1.0.3", + "twilio": "^3.56.0", + "web-push": "^3.4.4", "ws": "^6.2.1", "xmldom": "^0.1.27", - "yauzl": "^2.10.0" + "yauzl": "^2.10.0", + "yubikeyotp": "^0.2.0" }, "repository": { "type": "git", diff --git a/public/commander.htm b/public/commander.htm index 00714c51..4f38a4b6 100644 --- a/public/commander.htm +++ b/public/commander.htm @@ -1,4 +1,4 @@ -
  
Disconnected