Fixed invalid agent invite page bug.
Ylian Saint-Hilaire committed
Apr 17, 2020 at 11:27 UTC
d7698dd342b244bdc2d52237157820f955b24c85
3 files changed
+3
-4
meshagent.js
+1
-1
@@ -464,7 +464,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
464
obj.agentInfo.agentId = common.ReadInt(msg, 6);
465
obj.agentInfo.agentVersion = common.ReadInt(msg, 10);
466
obj.agentInfo.platformType = common.ReadInt(msg, 14);
467
- if (obj.agentInfo.platformType > 6 || obj.agentInfo.platformType < 1) { obj.agentInfo.platformType = 1; }
467
+ if (obj.agentInfo.platformType > 8 || obj.agentInfo.platformType < 1) { obj.agentInfo.platformType = 1; }
468
if (msg.substring(50, 66) == '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0') {
469
obj.meshid = Buffer.from(msg.substring(18, 50), 'binary').toString('hex'); // Older HEX MeshID
470
} else {
views/default.handlebars
-1
@@ -1385,7 +1385,6 @@
1385
//if (hide & 16) { QV('page_leftbar', false); QS('page_content').left = '0px'; }
1386
if (!footerBar) { QC('body').add('nofooter'); } else { QC('body').remove('nofooter'); }
1387
1388
- console.log('args.hide', args.hide);
1388
if (args.hide != 0) {
1389
// Fix the main grid to zero-height elements we want to hide.
1390
if (uiMode == 2) {
webserver.js
+2
-2
@@ -1359,7 +1359,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1359
var installflags = cookie.f;
1360
if (typeof installflags != 'number') { installflags = 0; }
1361
parent.debug('web', 'handleAgentInviteRequest using cookie.');
1362
- 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));
1362
+ 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));
1363
} else if (req.query.m != null) {
1364
// The MeshId is specified in the query string, use that
1365
var mesh = obj.meshes['mesh/' + domain.id + '/' + req.query.m.toLowerCase()];
@@ -1368,7 +1368,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1368
if (req.query.f) { installflags = parseInt(req.query.f); }
1369
if (typeof installflags != 'number') { installflags = 0; }
1370
parent.debug('web', 'handleAgentInviteRequest using meshid.');
1371
- 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));
1371
+ 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));
1372
}
1373
}
1374