Merge branch '0.0.10-alpha' of ssh://numinibsd/git/base/enigma-bbs into security-updates

This commit is contained in:
Bryan Ashby
2019-06-11 18:25:35 -06:00
16 changed files with 1107 additions and 37 deletions

View File

@@ -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 () {