mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-13 05:56:34 +03:00
Factorize close command + bugfix
This commit is contained in:
parent
fe4d426bdb
commit
c51cfef7c0
14
meshuser.js
14
meshuser.js
@ -3188,13 +3188,6 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'close':
|
||||
{
|
||||
// Close the web socket session
|
||||
if (obj.req.session && obj.req.session.ws && obj.req.session.ws == ws) { delete obj.req.session.ws; }
|
||||
try { ws.close(); } catch (e) { }
|
||||
break;
|
||||
}
|
||||
case 'getcookie':
|
||||
{
|
||||
// Check if this user has rights on this nodeid
|
||||
@ -5190,6 +5183,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||
'authcookie': serverCommandAuthCookie,
|
||||
'changeemail': serverCommandChangeEmail,
|
||||
'changelang': serverCommandChangeLang,
|
||||
'close': serverCommandClose,
|
||||
'files': serverCommandFiles,
|
||||
'getnetworkinfo': serverCommandGetNetworkInfo,
|
||||
'getsysinfo': serverCommandGetSysInfo,
|
||||
@ -5793,6 +5787,12 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||
parent.parent.DispatchEvent(targets, obj, message);
|
||||
}
|
||||
|
||||
function serverCommandClose(command) {
|
||||
// Close the web socket session
|
||||
try { delete obj.req.session.ws; } catch (e) { }
|
||||
try { ws.close(); } catch (e) { }
|
||||
}
|
||||
|
||||
function serverCommandFiles(command) {
|
||||
// Send the full list of server files to the browser app
|
||||
updateUserFiles(user, ws, domain);
|
||||
|
Loading…
Reference in New Issue
Block a user