Fixed invalid agent invite page bug.
This commit is contained in:
parent
12725d587d
commit
d7698dd342
|
@ -464,7 +464,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
||||||
obj.agentInfo.agentId = common.ReadInt(msg, 6);
|
obj.agentInfo.agentId = common.ReadInt(msg, 6);
|
||||||
obj.agentInfo.agentVersion = common.ReadInt(msg, 10);
|
obj.agentInfo.agentVersion = common.ReadInt(msg, 10);
|
||||||
obj.agentInfo.platformType = common.ReadInt(msg, 14);
|
obj.agentInfo.platformType = common.ReadInt(msg, 14);
|
||||||
if (obj.agentInfo.platformType > 6 || obj.agentInfo.platformType < 1) { obj.agentInfo.platformType = 1; }
|
if (obj.agentInfo.platformType > 8 || obj.agentInfo.platformType < 1) { obj.agentInfo.platformType = 1; }
|
||||||
if (msg.substring(50, 66) == '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0') {
|
if (msg.substring(50, 66) == '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0') {
|
||||||
obj.meshid = Buffer.from(msg.substring(18, 50), 'binary').toString('hex'); // Older HEX MeshID
|
obj.meshid = Buffer.from(msg.substring(18, 50), 'binary').toString('hex'); // Older HEX MeshID
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1385,7 +1385,6 @@
|
||||||
//if (hide & 16) { QV('page_leftbar', false); QS('page_content').left = '0px'; }
|
//if (hide & 16) { QV('page_leftbar', false); QS('page_content').left = '0px'; }
|
||||||
if (!footerBar) { QC('body').add('nofooter'); } else { QC('body').remove('nofooter'); }
|
if (!footerBar) { QC('body').add('nofooter'); } else { QC('body').remove('nofooter'); }
|
||||||
|
|
||||||
console.log('args.hide', args.hide);
|
|
||||||
if (args.hide != 0) {
|
if (args.hide != 0) {
|
||||||
// Fix the main grid to zero-height elements we want to hide.
|
// Fix the main grid to zero-height elements we want to hide.
|
||||||
if (uiMode == 2) {
|
if (uiMode == 2) {
|
||||||
|
|
|
@ -1359,7 +1359,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||||
var installflags = cookie.f;
|
var installflags = cookie.f;
|
||||||
if (typeof installflags != 'number') { installflags = 0; }
|
if (typeof installflags != 'number') { installflags = 0; }
|
||||||
parent.debug('web', 'handleAgentInviteRequest using cookie.');
|
parent.debug('web', 'handleAgentInviteRequest using cookie.');
|
||||||
render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: mesh._id.split('/')[2], serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: ((args.notls == true) ? '0' : '1'), servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name), installflags: installflags }, domain));
|
render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: mesh._id.split('/')[2], serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: ((args.notls == true) ? '0' : '1'), servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name).split('\'').join('%27'), installflags: installflags }, domain));
|
||||||
} else if (req.query.m != null) {
|
} else if (req.query.m != null) {
|
||||||
// The MeshId is specified in the query string, use that
|
// The MeshId is specified in the query string, use that
|
||||||
var mesh = obj.meshes['mesh/' + domain.id + '/' + req.query.m.toLowerCase()];
|
var mesh = obj.meshes['mesh/' + domain.id + '/' + req.query.m.toLowerCase()];
|
||||||
|
@ -1368,7 +1368,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||||
if (req.query.f) { installflags = parseInt(req.query.f); }
|
if (req.query.f) { installflags = parseInt(req.query.f); }
|
||||||
if (typeof installflags != 'number') { installflags = 0; }
|
if (typeof installflags != 'number') { installflags = 0; }
|
||||||
parent.debug('web', 'handleAgentInviteRequest using meshid.');
|
parent.debug('web', 'handleAgentInviteRequest using meshid.');
|
||||||
render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: mesh._id.split('/')[2], serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: ((args.notls == true) ? '0' : '1'), servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name), installflags: installflags }, domain));
|
render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: mesh._id.split('/')[2], serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: ((args.notls == true) ? '0' : '1'), servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name).split('\'').join('%27'), installflags: installflags }, domain));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue