diff --git a/restrict_logins/__manifest__.py b/restrict_logins/__manifest__.py
index a34677389..216b0620a 100644
--- a/restrict_logins/__manifest__.py
+++ b/restrict_logins/__manifest__.py
@@ -21,7 +21,7 @@
###############################################################################
{
'name': 'Restrict Concurrent User Login',
- 'version': '15.0.1.0.0',
+ 'version': '15.0.1.1.0',
'category': 'Extra Tools',
'summary': """Ensures restricted concurrent sessions, enforces user force
logout, and automates session expiry for enhanced security.""",
@@ -33,10 +33,12 @@
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
+ 'depends':['base_setup',],
'data': [
'data/ir_cron_data.xml',
'views/res_users_views.xml',
'views/login_clear_session_template.xml',
+ 'views/res_config_settings_views.xml',
],
'images': ['static/description/banner.png'],
'license': 'LGPL-3',
diff --git a/restrict_logins/controllers/restrict_logins.py b/restrict_logins/controllers/restrict_logins.py
index 91f5084ba..eeed66050 100644
--- a/restrict_logins/controllers/restrict_logins.py
+++ b/restrict_logins/controllers/restrict_logins.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+ # -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
diff --git a/restrict_logins/models/__init__.py b/restrict_logins/models/__init__.py
index 127fbdbdd..e872b610a 100644
--- a/restrict_logins/models/__init__.py
+++ b/restrict_logins/models/__init__.py
@@ -19,5 +19,7 @@
# If not, see .
#
###############################################################################
-from . import res_users
from . import ir_http
+from . import res_config_settings
+from . import res_users
+
diff --git a/restrict_logins/models/ir_http.py b/restrict_logins/models/ir_http.py
index ec83c6285..916a336e2 100644
--- a/restrict_logins/models/ir_http.py
+++ b/restrict_logins/models/ir_http.py
@@ -60,7 +60,10 @@ class IrHttp(models.AbstractModel):
sid = request.session.sid
last_update = user_pool.last_update
now = datetime.now()
- exp_date = datetime.now() + timedelta(minutes=45)
+ session_time_limit = int(
+ request.env['ir.config_parameter'].sudo().get_param(
+ 'restrict_logins.session_expire_time'))
+ exp_date = datetime.now() + timedelta(minutes=session_time_limit)
# Check that the authentication contains bus_inactivity
request_params = request.params.copy()
if 'options' in request_params and 'bus_inactivity' in \
diff --git a/restrict_logins/models/res_config_settings.py b/restrict_logins/models/res_config_settings.py
new file mode 100644
index 000000000..947368b96
--- /dev/null
+++ b/restrict_logins/models/res_config_settings.py
@@ -0,0 +1,9 @@
+from odoo import fields, models
+
+
+class ResConfigSettings(models.TransientModel):
+ _inherit = 'res.config.settings'
+
+ session_expire_time = fields.Integer('Session Expire time In Minutes', config_parameter='restrict_logins.session_expire_time')
+
+
diff --git a/restrict_logins/models/res_users.py b/restrict_logins/models/res_users.py
index 4da7a02d7..a98eb4269 100644
--- a/restrict_logins/models/res_users.py
+++ b/restrict_logins/models/res_users.py
@@ -98,7 +98,9 @@ class ResUsers(models.Model):
def _save_session(self):
""" Function for saving session details of the corresponding user."""
- exp_date = datetime.utcnow() + timedelta(minutes=45)
+ session_time_limit = int(self.env['ir.config_parameter'].sudo().get_param(
+ 'restrict_logins.session_expire_time'))
+ exp_date = datetime.utcnow() + timedelta(minutes=session_time_limit)
sid = request.httprequest.session.sid
self.with_user(SUPERUSER_ID).write({
'sid': sid,
diff --git a/restrict_logins/static/description/assets/screenshots/restrict_session_1.png b/restrict_logins/static/description/assets/screenshots/restrict_session_1.png
new file mode 100644
index 000000000..d4ed693b2
Binary files /dev/null and b/restrict_logins/static/description/assets/screenshots/restrict_session_1.png differ
diff --git a/restrict_logins/static/description/assets/screenshots/restrict_session_2.png b/restrict_logins/static/description/assets/screenshots/restrict_session_2.png
new file mode 100644
index 000000000..2f1dd85b7
Binary files /dev/null and b/restrict_logins/static/description/assets/screenshots/restrict_session_2.png differ
diff --git a/restrict_logins/static/description/assets/screenshots/restrict_session_time.png b/restrict_logins/static/description/assets/screenshots/restrict_session_time.png
new file mode 100644
index 000000000..530182ef7
Binary files /dev/null and b/restrict_logins/static/description/assets/screenshots/restrict_session_time.png differ
diff --git a/restrict_logins/static/description/index.html b/restrict_logins/static/description/index.html
index d7b9fea88..790f93537 100644
--- a/restrict_logins/static/description/index.html
+++ b/restrict_logins/static/description/index.html
@@ -190,6 +190,31 @@
Enable the ability to force logout from devices that are already logged in.
+
+
+
+ Option to set the Session expiration time limit.
+
+ Inside the Settings, we have an option to set the session expiration time limit in minutes.
+
+
+
+
+
+
+ Current Session Expiration Time.
+
+ The session expiration time will be automatically set for users based on the time limit configured in the Settings.
+
+
+
+
+
+ Current Session Expiration Update.
+
+ The session expiration time will update automatically when the system is used continuously. However, if the system remains idle, it will automatically log out once the session expiration time is reached.