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

Fixed user consent with guest sharing, #3492

This commit is contained in:
Ylian Saint-Hilaire 2022-01-24 09:56:12 -08:00
parent 106c3ca461
commit 9d621f23c6
3 changed files with 9 additions and 2 deletions

View file

@ -1657,7 +1657,14 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
}
case 'getUserImage': {
// Validate input
if (typeof command.userid != 'string') return;
if (typeof command.userid != 'string') {
// Send back the default image if required
if ((command.default) || (command.sentDefault)) {
try { command.image = 'data:image/png;base64,' + Buffer.from(parent.fs.readFileSync(parent.parent.path.join(__dirname, 'public', 'images', 'user-128.png')), 'binary').toString('base64'); } catch (ex) { }
obj.send(JSON.stringify(command));
}
return;
}
var useridsplit = command.userid.split('/');
if ((useridsplit.length != 3) || (useridsplit[1] != domain.id)) return;