mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 23:25:53 -05:00
disconnect sessions first before logout on idletimeout (#5838)
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
272015483b
commit
936aaa0b2b
@ -2330,7 +2330,23 @@
|
||||
function setSessionActivity() { sessionActivity = Date.now(); QH('idleTimeoutNotify', ''); }
|
||||
function checkIdleSessionTimeout() {
|
||||
var delta = (Date.now() - sessionActivity);
|
||||
if (delta > serverinfo.timeout) { window.location.href = 'logout'; } else {
|
||||
if (delta > serverinfo.timeout) {
|
||||
if (desktop != null) { // Disconnect remote desktop
|
||||
desktop.Stop();
|
||||
webRtcDesktopReset();
|
||||
desktopNode = desktop = null;
|
||||
if (pluginHandler != null) { pluginHandler.callHook('onDesktopDisconnect'); }
|
||||
}
|
||||
if (terminal != null) { // Disconnect terminal
|
||||
terminal.Stop();
|
||||
terminal = null;
|
||||
}
|
||||
if (files != null) { // Disconnect files
|
||||
files.Stop();
|
||||
files = null;
|
||||
}
|
||||
window.location.href = 'logout';
|
||||
} else {
|
||||
var ds = Math.round((serverinfo.timeout - delta) / 1000);
|
||||
if (ds <= 60) {
|
||||
QH('idleTimeoutNotify', '<br />' + format((ds == 1)?"1 second until disconnect":"{0} seconds until disconnect", ds));
|
||||
|
Loading…
Reference in New Issue
Block a user