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

Added user IP filtering.

This commit is contained in:
Ylian Saint-Hilaire 2017-09-27 12:43:20 -07:00
parent 0b86ecefa5
commit 646bc67365
5 changed files with 116 additions and 17 deletions

View file

@ -1742,7 +1742,13 @@
if (node.userloc) { loc = node.userloc; t = 4; }
if ((loc == null) || (typeof loc != 'string')) return;
loc = loc.split(',');
return [ parseFloat(loc[0]) + (stringToIntHash(node._id.substring(0, 20)) / 100000000000), parseFloat(loc[1]) + (stringToIntHash(node._id.substring(20)) / 100000000000), t ]
if (t == 1) {
// If this is IP location, randomize the position a little.
return [ parseFloat(loc[0]) + (stringToIntHash(node._id.substring(0, 20)) / 100000000000), parseFloat(loc[1]) + (stringToIntHash(node._id.substring(20)) / 100000000000), t ];
} else {
// Return the real position
return [ parseFloat(loc[0]), parseFloat(loc[1]), t ];
}
}
// Load the entire map