v1.18.x
barisusakli 9 years ago
parent 11236bb841
commit 2606844d98

@ -7,5 +7,6 @@
"alternative_logins": "Alternative Logins", "alternative_logins": "Alternative Logins",
"failed_login_attempt": "Login Unsuccessful", "failed_login_attempt": "Login Unsuccessful",
"login_successful": "You have successfully logged in!", "login_successful": "You have successfully logged in!",
"dont_have_account": "Don't have an account?" "dont_have_account": "Don't have an account?",
"logged-out-due-to-inactivity": "You have been logged out due to inactivity"
} }

@ -2,9 +2,23 @@
/*global config, translator, componentHandler, define, socket, app, ajaxify, utils, bootbox, Slideout, NProgress, RELATIVE_PATH*/ /*global config, translator, componentHandler, define, socket, app, ajaxify, utils, bootbox, Slideout, NProgress, RELATIVE_PATH*/
(function() { (function() {
var logoutTimer = 0;
function startLogoutTimer() {
if (logoutTimer) {
clearTimeout(logoutTimer);
}
logoutTimer = setTimeout(function() {
app.alert({
message: '[[login:logged-out-due-to-inactivity]]'
});
setTimeout(app.logout, 5000);
}, 3600000);
}
$(window).on('action:ajaxify.end', function() { $(window).on('action:ajaxify.end', function() {
showCorrectNavTab(); showCorrectNavTab();
startLogoutTimer();
}); });
function showCorrectNavTab() { function showCorrectNavTab() {

@ -206,6 +206,7 @@ middleware.isAdmin = function(req, res, next) {
var loginTime = req.session.meta ? req.session.meta.datetime : 0; var loginTime = req.session.meta ? req.session.meta.datetime : 0;
if (loginTime && parseInt(loginTime, 10) > Date.now() - 3600000) { if (loginTime && parseInt(loginTime, 10) > Date.now() - 3600000) {
req.session.meta.datetime += 300000;
return next(); return next();
} }

Loading…
Cancel
Save