mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-22 04:33:16 +03:00
fix adding meshes and user groups in a peering environment (#6534)
This commit is contained in:
parent
727080ab68
commit
3da60b43ac
26
db.js
26
db.js
@ -4089,12 +4089,13 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send the mesh update
|
// Send the mesh update
|
||||||
if (mesh.deleted) { mesh.action = 'deletemesh'; } else { mesh.action = (added ? 'createmesh' : 'meshchange'); }
|
var mesh2 = Object.assign({}, mesh); // Shallow clone
|
||||||
mesh.meshid = mesh._id;
|
if (mesh2.deleted) { mesh2.action = 'deletemesh'; } else { mesh2.action = (added ? 'createmesh' : 'meshchange'); }
|
||||||
mesh.nolog = 1;
|
mesh2.meshid = mesh2._id;
|
||||||
delete mesh.type;
|
mesh2.nolog = 1;
|
||||||
delete mesh._id;
|
delete mesh2.type;
|
||||||
parent.DispatchEvent(['*', mesh.meshid], obj, parent.webserver.CloneSafeMesh(mesh));
|
delete mesh2._id;
|
||||||
|
parent.DispatchEvent(['*', mesh2.meshid], obj, parent.webserver.CloneSafeMesh(mesh2));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when a user account has changed
|
// Called when a user account has changed
|
||||||
@ -4138,12 +4139,13 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send the user group update
|
// Send the user group update
|
||||||
usergroup.action = (added ? 'createusergroup' : 'usergroupchange');
|
var usergroup2 = Object.assign({}, usergroup); // Shallow clone
|
||||||
usergroup.ugrpid = usergroup._id;
|
usergroup2.action = (added ? 'createusergroup' : 'usergroupchange');
|
||||||
usergroup.nolog = 1;
|
usergroup2.ugrpid = usergroup2._id;
|
||||||
delete usergroup.type;
|
usergroup2.nolog = 1;
|
||||||
delete usergroup._id;
|
delete usergroup2.type;
|
||||||
parent.DispatchEvent(['*', usergroup.ugrpid], obj, usergroup);
|
delete usergroup2._id;
|
||||||
|
parent.DispatchEvent(['*', usergroup2.ugrpid], obj, usergroup2);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbMergeSqlArray(arr) {
|
function dbMergeSqlArray(arr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user