mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
Merge branch '0.0.10-alpha' of ssh://numinibsd/git/base/enigma-bbs into security-updates
This commit is contained in:
commit
f8788d56d6
16 changed files with 1107 additions and 37 deletions
|
@ -433,6 +433,11 @@ Client.prototype.setTermType = function(termType) {
|
|||
};
|
||||
|
||||
Client.prototype.startIdleMonitor = function() {
|
||||
// clear existing, if any
|
||||
if(this.idleCheck) {
|
||||
this.stopIdleMonitor();
|
||||
}
|
||||
|
||||
this.lastKeyPressMs = Date.now();
|
||||
|
||||
//
|
||||
|
@ -468,6 +473,9 @@ Client.prototype.startIdleMonitor = function() {
|
|||
idleLogoutSeconds = Config().users.preAuthIdleLogoutSeconds;
|
||||
}
|
||||
|
||||
// use override value if set
|
||||
idleLogoutSeconds = this.idleLogoutSecondsOverride || idleLogoutSeconds;
|
||||
|
||||
if(nowMs - this.lastKeyPressMs >= (idleLogoutSeconds * 1000)) {
|
||||
this.emit('idle timeout');
|
||||
}
|
||||
|
@ -475,7 +483,18 @@ Client.prototype.startIdleMonitor = function() {
|
|||
};
|
||||
|
||||
Client.prototype.stopIdleMonitor = function() {
|
||||
clearInterval(this.idleCheck);
|
||||
if(this.idleCheck) {
|
||||
clearInterval(this.idleCheck);
|
||||
delete this.idleCheck;
|
||||
}
|
||||
};
|
||||
|
||||
Client.prototype.overrideIdleLogoutSeconds = function(seconds) {
|
||||
this.idleLogoutSecondsOverride = seconds;
|
||||
};
|
||||
|
||||
Client.prototype.restoreIdleLogoutSeconds = function() {
|
||||
delete this.idleLogoutSecondsOverride;
|
||||
};
|
||||
|
||||
Client.prototype.end = function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue