mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 12:52:54 -05:00
@@ -1058,7 +1058,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||
db.Get('iploc_' + obj.remoteaddr, function (err, iplocs) {
|
||||
if ((iplocs != null) && (iplocs.length == 1)) {
|
||||
// We have a location in the database for this remote IP
|
||||
const iploc = nodes[0], x = {};
|
||||
const iploc = iplocs[0], x = {};
|
||||
if ((iploc != null) && (iploc.ip != null) && (iploc.loc != null)) {
|
||||
x.publicip = iploc.ip;
|
||||
x.iploc = iploc.loc + ',' + (Math.floor((new Date(iploc.date)) / 1000));
|
||||
@@ -1067,10 +1067,10 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||
} else {
|
||||
// Check if we need to ask for the IP location
|
||||
var doIpLocation = 0;
|
||||
if (device.iploc == null) {
|
||||
if (obj.iploc == null) {
|
||||
doIpLocation = 1;
|
||||
} else {
|
||||
const loc = device.iploc.split(',');
|
||||
const loc = obj.iploc.split(',');
|
||||
if (loc.length < 3) {
|
||||
doIpLocation = 2;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user