mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Guest sharing fixes.
This commit is contained in:
parent
ac6c4ba1bc
commit
902e71a96f
3 changed files with 18 additions and 3 deletions
|
@ -4696,8 +4696,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||||
|
|
||||||
//var cookie = { a: 5, p: command.p, uid: user._id, gn: command.guestname, nid: node._id, cf: command.consent, pid: publicid };
|
//var cookie = { a: 5, p: command.p, uid: user._id, gn: command.guestname, nid: node._id, cf: command.consent, pid: publicid };
|
||||||
var cookie = { a: 6, pid: publicid };
|
var cookie = { a: 6, pid: publicid };
|
||||||
//if ((startTime != null) && (expireTime != null)) { command.start = cookie.start = startTime; command.expire = cookie.expire = expireTime; }
|
if ((startTime != null) && (expireTime != null)) { command.start = startTime; command.expire = cookie.e = expireTime; }
|
||||||
//if (command.viewOnly === true) { cookie.vo = 1; }
|
|
||||||
const inviteCookie = parent.parent.encodeCookie(cookie, parent.parent.invitationLinkEncryptionKey);
|
const inviteCookie = parent.parent.encodeCookie(cookie, parent.parent.invitationLinkEncryptionKey);
|
||||||
if (inviteCookie == null) { if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'createDeviceShareLink', responseid: command.responseid, result: 'Unable to generate shareing cookie' })); } catch (ex) { } } return; }
|
if (inviteCookie == null) { if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'createDeviceShareLink', responseid: command.responseid, result: 'Unable to generate shareing cookie' })); } catch (ex) { } } return; }
|
||||||
|
|
||||||
|
|
14
package.json
14
package.json
|
@ -36,6 +36,8 @@
|
||||||
"sample-config-advanced.json"
|
"sample-config-advanced.json"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"archiver": "^4.0.2",
|
||||||
|
"archiver-zip-encrypted": "^1.0.10",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"cbor": "~5.2.0",
|
"cbor": "~5.2.0",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
|
@ -43,13 +45,23 @@
|
||||||
"express": "^4.17.0",
|
"express": "^4.17.0",
|
||||||
"express-handlebars": "^3.1.0",
|
"express-handlebars": "^3.1.0",
|
||||||
"express-ws": "^4.0.0",
|
"express-ws": "^4.0.0",
|
||||||
|
"image-size": "^1.0.0",
|
||||||
"ipcheck": "^0.1.0",
|
"ipcheck": "^0.1.0",
|
||||||
|
"loadavg-windows": "^1.1.1",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
|
"mongodb": "^4.1.0",
|
||||||
"multiparty": "^4.2.1",
|
"multiparty": "^4.2.1",
|
||||||
"nedb": "^1.8.0",
|
"nedb": "^1.8.0",
|
||||||
"node-forge": "^0.10.0",
|
"node-forge": "^0.10.0",
|
||||||
|
"node-rdpjs-2": "^0.3.5",
|
||||||
|
"node-windows": "^1.0.0-beta.5",
|
||||||
|
"otplib": "^10.2.3",
|
||||||
|
"saslprep": "^1.0.3",
|
||||||
|
"ssh2": "^1.4.0",
|
||||||
|
"web-push": "^3.4.5",
|
||||||
"ws": "^5.2.3",
|
"ws": "^5.2.3",
|
||||||
"yauzl": "^2.10.0"
|
"yauzl": "^2.10.0",
|
||||||
|
"yubikeyotp": "^0.2.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -3490,6 +3490,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||||
// This is the new style sharing cookie, just encodes the pointer to the sharing information in the database.
|
// This is the new style sharing cookie, just encodes the pointer to the sharing information in the database.
|
||||||
// Gives a much more compact URL.
|
// Gives a much more compact URL.
|
||||||
if (typeof c.pid != 'string') { res.sendStatus(404); return; }
|
if (typeof c.pid != 'string') { res.sendStatus(404); return; }
|
||||||
|
|
||||||
|
// Check the expired time, expire message.
|
||||||
|
if ((c.e != null) && (c.e <= Date.now())) { render(req, res, getRenderPage((domain.sitestyle == 2) ? 'message2' : 'message', req, domain), getRenderArgs({ titleid: 2, msgid: 12, domainurl: encodeURIComponent(domain.url).replace(/'/g, '%27') }, req, domain)); return; }
|
||||||
|
|
||||||
obj.db.Get('deviceshare-' + c.pid, function (err, docs) {
|
obj.db.Get('deviceshare-' + c.pid, function (err, docs) {
|
||||||
if ((err != null) || (docs == null) || (docs.length != 1)) { res.sendStatus(404); return; }
|
if ((err != null) || (docs == null) || (docs.length != 1)) { res.sendStatus(404); return; }
|
||||||
const doc = docs[0];
|
const doc = docs[0];
|
||||||
|
|
Loading…
Reference in a new issue