Merge branch '0.0.10-alpha' of ssh://numinibsd/git/base/enigma-bbs into security-updates
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user