fix logoutOnIdleSessionTimeout spelling and extra translations #6851

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2025-03-08 16:48:37 +00:00
parent b949cecc5f
commit 0e3a6b4915
8 changed files with 10272 additions and 9928 deletions

View File

@ -601,11 +601,11 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
}
if (typeof domain.userconsentflags == 'number') { serverinfo.consent = domain.userconsentflags; }
if ((typeof domain.usersessionidletimeout == 'number') && (domain.usersessionidletimeout > 0)) {serverinfo.timeout = (domain.usersessionidletimeout * 60 * 1000); }
if (typeof domain.logoutOnIdleSessionTimeout == 'boolean') {
serverinfo.logoutOnIdleSessionTimeout = domain.logoutOnIdleSessionTimeout;
if (typeof domain.logoutonidlesessiontimeout == 'boolean') {
serverinfo.logoutonidlesessiontimeout = domain.logoutonidlesessiontimeout;
} else {
// Default
serverinfo.logoutOnIdleSessionTimeout = true;
serverinfo.logoutonidlesessiontimeout = true;
}
if (user.siteadmin === SITERIGHT_ADMIN) {
if (parent.parent.config.settings.managealldevicegroups.indexOf(user._id) >= 0) { serverinfo.manageAllDeviceGroups = true; }

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,7 @@ var meshCentralSourceFiles = [
"../views/messenger.handlebars",
"../views/player.handlebars",
"../views/sharing.handlebars",
"../views/sharing-mobile.handlebars",
"../views/mstsc.handlebars",
"../views/ssh.handlebars",
"../emails/account-check.html",

File diff suppressed because it is too large Load Diff

View File

@ -1524,8 +1524,22 @@
function setSessionActivity() { sessionActivity = Date.now(); }
function checkIdleSessionTimeout() {
var delta = (Date.now() - sessionActivity);
if (delta > serverinfo.timeout && serverinfo.logoutOnIdleSessionTimeout) {
window.location.href = 'logout';
if (delta > serverinfo.timeout) {
if (desktop != null) { // Disconnect remote desktop
desktop.Stop();
desktopNode = desktop = null;
}
if (terminal != null) { // Disconnect terminal
terminal.Stop();
terminal = null;
}
if (files != null) { // Disconnect files
files.Stop();
files = null;
}
if (serverinfo.logoutonidlesessiontimeout) {
window.location.href = 'logout';
}
}
}

View File

@ -2447,17 +2447,28 @@
files.Stop();
files = null;
}
if (serverinfo.logoutOnIdleSessionTimeout) {
if (serverinfo.logoutonidlesessiontimeout) {
window.location.href = 'logout';
}
} else {
var ds = Math.round((serverinfo.timeout - delta) / 1000);
var sessionInProgress = desktop != null || terminal != null || files != null;
var show = serverinfo.logoutonidlesessiontimeout || sessionInProgress;
var isLogout = serverinfo.logoutonidlesessiontimeout;
var theText = ''; // Initialize theText
if (ds <= 60) {
QH('idleTimeoutNotify', '<br />' + format((ds == 1)?"1 second until disconnect":"{0} seconds until disconnect", ds));
theText = isLogout
? (ds == 1 ? "1 second until logout" : "{0} seconds until logout")
: (ds == 1 ? "1 second until disconnect" : "{0} seconds until disconnect");
} else {
ds = Math.round(ds / 60);
if (ds <= 5) { QH('idleTimeoutNotify', '<br />' + format((ds == 1)?"1 minute until disconnect":"{0} minutes until disconnect", ds)); }
if (ds <= 5) {
theText = isLogout
? (ds == 1 ? "1 minute until logout" : "{0} minutes until logout")
: (ds == 1 ? "1 minute until disconnect" : "{0} minutes until disconnect");
}
}
QH('idleTimeoutNotify', show && theText ? '<br />' + format(theText, ds) : '');
}
}
@ -11356,7 +11367,7 @@
}
function p13openfilefolder() {
setDialogMode(2, "Open File/Folder", 3, p13openfilefolderEx, "Are you sure you want to open this file/folder on the remote devices desktop ?");
setDialogMode(2, "Open File/Folder", 3, p13openfilefolderEx, "Are you sure you want to open this file/folder on the remote devices desktop?");
}
function p13openfilefolderEx() {
var openfilefolder = "", checkboxes = document.getElementsByName('fd');

View File

@ -2897,17 +2897,28 @@
files.Stop();
files = null;
}
if (serverinfo.logoutOnIdleSessionTimeout) {
if (serverinfo.logoutonidlesessiontimeout) {
window.location.href = 'logout';
}
} else {
var ds = Math.round((serverinfo.timeout - delta) / 1000);
var sessionInProgress = (desktop != null || terminal != null || files != null);
var show = serverinfo.logoutonidlesessiontimeout || sessionInProgress;
var isLogout = serverinfo.logoutonidlesessiontimeout;
var theText = '';
if (ds <= 60) {
QH('idleTimeoutNotify', '<br />' + format((ds == 1) ? "1 second until disconnect" : "{0} seconds until disconnect", ds));
theText = isLogout
? (ds == 1 ? "1 second until logout" : "{0} seconds until logout")
: (ds == 1 ? "1 second until disconnect" : "{0} seconds until disconnect");
} else {
ds = Math.round(ds / 60);
if (ds <= 5) { QH('idleTimeoutNotify', '<br />' + format((ds == 1) ? "1 minute until disconnect" : "{0} minutes until disconnect", ds)); }
if (ds <= 5) {
theText = isLogout
? (ds == 1 ? "1 minute until logout" : "{0} minutes until logout")
: (ds == 1 ? "1 minute until disconnect" : "{0} minutes until disconnect");
}
}
QH('idleTimeoutNotify', show && theText ? '<br />' + format(theText, ds) : '');
}
}
@ -12150,7 +12161,7 @@
}
function p13openfilefolder() {
setModalContent('xxAddAgent', "Open File/Folder", 'Are you sure you want to open this file/folder on the remote devices desktop ?');
setModalContent('xxAddAgent', "Open File/Folder", "Are you sure you want to open this file/folder on the remote devices desktop?");
showModal('xxAddAgentModal', 'idx_dlgOkButton', () => p13openfilefolderEx());
}
function p13openfilefolderEx() {

View File

@ -822,8 +822,22 @@
function setSessionActivity() { sessionActivity = Date.now(); }
function checkIdleSessionTimeout() {
var delta = (Date.now() - sessionActivity);
if (delta > serverinfo.timeout && serverinfo.logoutOnIdleSessionTimeout) {
window.location.href = 'logout';
if (delta > serverinfo.timeout) {
if (desktop != null) { // Disconnect remote desktop
desktop.Stop();
desktopNode = desktop = null;
}
if (terminal != null) { // Disconnect terminal
terminal.Stop();
terminal = null;
}
if (files != null) { // Disconnect files
files.Stop();
files = null;
}
if (serverinfo.logoutonidlesessiontimeout) {
window.location.href = 'logout';
}
}
}