1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Fixed mobile app.

This commit is contained in:
Ylian Saint-Hilaire 2019-10-04 11:38:47 -07:00
parent 5af831a0aa
commit 407518e102
4 changed files with 18 additions and 3 deletions

View file

@ -492,6 +492,22 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
// Return the mesh for this device, in some cases, we may auto-create the mesh.
function getMeshAutoCreate() {
var mesh = parent.meshes[obj.dbMeshKey];
// If the mesh was not found and we are in LAN mode, check of the domain can be corrected
if ((args.lanonly == true) && (mesh == null)) {
var smesh = obj.dbMeshKey.split('/');
for (var i in parent.parent.config.domains) {
mesh = parent.meshes['mesh/' + i + '/' + smesh[2]];
if (mesh != null) {
obj.domain = domain = parent.parent.config.domains[i];
obj.meshid = smesh[2];
obj.dbMeshKey = 'mesh/' + i + '/' + smesh[2];
obj.dbNodeKey = 'node/' + domain.id + '/' + obj.nodeid;
break;
}
}
}
if ((mesh == null) && (typeof domain.orphanagentuser == 'string')) {
const adminUser = parent.users['user/' + domain.id + '/' + domain.orphanagentuser.toLowerCase()];
if ((adminUser != null) && (adminUser.siteadmin == 0xFFFFFFFF)) {