diff --git a/db.js b/db.js index 54d5b3ce..11b1d197 100644 --- a/db.js +++ b/db.js @@ -812,6 +812,13 @@ module.exports.CreateDB = function (parent, func) { // Called when a device group has changed function dbMeshChange(meshChange, added) { const mesh = meshChange.fullDocument; + + // Update the mesh object in memory + const mmesh = parent.webserver.meshes[mesh._id]; + for (var i in mesh) { mmesh[i] = mesh[i]; } + for (var i in mmesh) { if (mesh[i] == null) { delete mmesh[i]; } } + + // Send the mesh update if (mesh.deleted) { mesh.action = 'deletemesh'; } else { mesh.action = (added ? 'createmesh' : 'meshchange'); } mesh.meshid = mesh._id; mesh.nolog = 1; @@ -823,6 +830,13 @@ module.exports.CreateDB = function (parent, func) { // Called when a user account has changed function dbUserChange(userChange, added) { const user = userChange.fullDocument; + + // Update the user object in memory + const muser = parent.webserver.users[user._id]; + for (var i in user) { muser[i] = user[i]; } + for (var i in muser) { if (user[i] == null) { delete muser[i]; } } + + // Send the user update parent.DispatchEvent(['*', 'server-users', user._id], obj, { etype: 'user', username: user.name, account: parent.webserver.CloneSafeUser(user), action: (added ? 'accountcreate' : 'accountchange'), domain: user.domain, nolog: 1 }); } diff --git a/package.json b/package.json index 58377497..abb065e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.3.5-p", + "version": "0.3.5-r", "keywords": [ "Remote Management", "Intel AMT",