[feature] allow blocking of multiple user sessions #884:
This commit is contained in:
parent
cc275ba7f9
commit
ee42ef37be
2 changed files with 13 additions and 0 deletions
|
|
@ -53,6 +53,15 @@ class HTTPRequest:
|
|||
# run login triggers
|
||||
if frappe.form_dict.get('cmd')=='login':
|
||||
frappe.local.login_manager.run_trigger('on_session_creation')
|
||||
self.clear_active_sessions()
|
||||
|
||||
def clear_active_sessions(self):
|
||||
if not frappe.conf.get("deny_multiple_sessions"):
|
||||
return
|
||||
|
||||
if frappe.session.user != "Guest":
|
||||
clear_sessions(frappe.session.user, keep_current=True)
|
||||
|
||||
|
||||
def set_lang(self, lang):
|
||||
from frappe.translate import guess_language_from_http_header
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
### Custom DocTypes
|
||||
|
||||
The user can add Custom DocTypes (Forms) without creating a new app by setting **Custom** property.
|
||||
|
||||
### Site Configuration
|
||||
|
||||
- Stop multiple logins for a user by setting `deny_multiple_sessions` in `site_config.json`. [Help on `site_config.json`](https://frappe.io/docs/user-guide/site_config).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue