Added auto logout option

This commit is contained in:
RainLoop Team 2015-02-18 23:52:52 +04:00
parent 76f319a07f
commit bb551e4ec8
18 changed files with 171 additions and 33 deletions

View file

@ -92,6 +92,10 @@
Globals.$html.removeClass('rl-ctrl-key-pressed');
}
});
Globals.$doc.on('mousemove keypress click', _.debounce(function () {
Events.pub('rl.auto-logout-refresh');
}, 5000));
}
_.extend(AbstractApp.prototype, AbstractBoot.prototype);

View file

@ -1398,6 +1398,15 @@
});
};
AppUser.prototype.logout = function ()
{
var self = this;
Remote.logout(function () {
self.loginAndLogoutReload(true,
Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length);
});
};
AppUser.prototype.bootstartLoginScreen = function ()
{
Globals.$html.removeClass('rl-user-auth').addClass('rl-user-no-auth');
@ -1568,6 +1577,10 @@
Remote.appDelayStart(Utils.emptyFunction);
}, 35000);
Events.sub('rl.auto-logout', function () {
self.logout();
});
Plugins.runHook('rl-start-user-screens');
Events.pub('rl.bootstart-user-screens');