diff --git a/restrict_logins/README.rst b/restrict_logins/README.rst new file mode 100644 index 000000000..5fe229a88 --- /dev/null +++ b/restrict_logins/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Restrict Concurrent User Login +============================== +This module ensures restricted concurrent sessions, enforces user force logout, and automates session expiry for enhanced security and user management. + +Configuration +============= +No additional configurations needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, Version 3 (LGPL v3) +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developers : (V13) Milind Mohan, + (V14) Aysha Shalin + Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/restrict_logins/__init__.py b/restrict_logins/__init__.py new file mode 100644 index 000000000..41847d807 --- /dev/null +++ b/restrict_logins/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import controllers +from . import models diff --git a/restrict_logins/__manifest__.py b/restrict_logins/__manifest__.py new file mode 100644 index 000000000..91be7608b --- /dev/null +++ b/restrict_logins/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Restrict Concurrent User Login', + 'version': '14.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Ensures restricted concurrent sessions, enforces user force + logout, and automates session expiry for enhanced security and user + management.""", + 'description': """This module ensures security by restricting concurrent + user sessions and provides the option for forced logout. It includes + automatic session expiry after a set duration, managing user logins + efficiently.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base'], + 'data': [ + 'data/ir_cron_data.xml', + 'views/res_users_views.xml', + 'views/login_clear_session_template.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/restrict_logins/controllers/__init__.py b/restrict_logins/controllers/__init__.py new file mode 100644 index 000000000..79a956d54 --- /dev/null +++ b/restrict_logins/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import main diff --git a/restrict_logins/controllers/main.py b/restrict_logins/controllers/main.py new file mode 100644 index 000000000..65e221195 --- /dev/null +++ b/restrict_logins/controllers/main.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +import os + +import werkzeug +import werkzeug.exceptions +import werkzeug.routing +from odoo.addons.web.controllers import main + +import odoo +import odoo.modules.registry +from odoo import SUPERUSER_ID +from odoo import http +from odoo.http import request +from odoo.tools._vendor import sessions +from odoo.tools.translate import _ + + +def clear_session_history(u_sid, f_uid=False): + """ Clear all the user session histories of a particular user """ + path = odoo.tools.config.session_dir + store = sessions.FilesystemSessionStore( + path, session_class=odoo.http.OpenERPSession, renew_missing=True) + session_fname = store.get_session_filename(u_sid) + try: + os.remove(session_fname) + return True + except OSError: + pass + return False + + +def super_clear_all(): + """ Clear all the user session histories """ + path = odoo.tools.config.session_dir + store = sessions.FilesystemSessionStore( + path, session_class=odoo.http.OpenERPSession, renew_missing=True) + for fname in os.listdir(store.path): + path = os.path.join(store.path, fname) + try: + os.unlink(path) + except OSError: + pass + return True + + +class Session(main.Session): + """ + This class includes methods to handle user logouts, clear individual user + sessions, and perform a force logout, which logs out from all devices. + """ + @http.route('/web/session/logout', type='http', auth="none") + def logout(self, redirect='/web'): + """ Logs out the current user by clearing their session. """ + user = request.env['res.users'].with_user(1).search( + [('id', '=', request.session.uid)]) + user._clear_session() # Clear user session + request.session.logout(keep_db=True) + return werkzeug.utils.redirect(redirect, 303) + + @http.route('/clear_all_sessions', type='http', auth="none") + def logout_all(self, redirect='/web', f_uid=False): + """ Log out from all the sessions of the current user. """ + if f_uid: + user = request.env['res.users'].with_user(1).browse(int(f_uid)) + if user: + # Clear session file for the user + session_cleared = clear_session_history(user.sid, f_uid) + if session_cleared: + user._clear_session() # Clear user session + request.session.logout(keep_db=True) + return werkzeug.utils.redirect(redirect, 303) + + @http.route('/super/logout_all', type='http', auth="none") + def super_logout_all(self, redirect='/web'): + """ Log out from all the sessions of all users. """ + users = request.env['res.users'].with_user(1).search([]) + for user in users: + # Clear session file for the user + session_cleared = super_clear_all() + if session_cleared: + user._clear_session() # Clear user session + request.session.logout(keep_db=True) + return werkzeug.utils.redirect(redirect, 303) + + +class Home(main.Home): + """ This class includes methods related to user authentication and login.""" + @http.route('/web/login', type='http', auth="none") + def web_login(self, redirect=None, **kw): + """ Handle user login through the web interface. """ + main.ensure_db() + request.params['login_success'] = False + if (request.httprequest.method == 'GET' and redirect and + request.session.uid): + return http.redirect_with_hash(redirect) + if not request.uid: + request.uid = odoo.SUPERUSER_ID + values = request.params.copy() + try: + values['databases'] = http.db_list() + except odoo.exceptions.AccessDenied: + values['databases'] = None + if request.httprequest.method == 'POST': + old_uid = request.uid + try: + uid = request.session.authenticate(request.session.db, + request.params['login'], + request.params['password']) + request.params['login_success'] = True + return http.redirect_with_hash( + self._login_redirect(uid, redirect=redirect)) + except odoo.exceptions.AccessDenied as e: + failed_uid = request.uid + request.uid = old_uid + if e.args == odoo.exceptions.AccessDenied().args: + values['error'] = _("Wrong login/password") + elif e.args[0] == "already_logged_in": + values['error'] = "User already logged in. Log out from " \ + "other devices and try again." + values['logout_all'] = True + values[ + 'failed_uid'] = failed_uid if ( + failed_uid != SUPERUSER_ID) else False + else: + values['error'] = e.args[0] + else: + if 'error' in request.params and request.params.get( + 'error') == 'access': + values['error'] = _('Only employee can access this database. ' + 'Please contact the administrator.') + if 'login' not in values and request.session.get('auth_login'): + values['login'] = request.session.get('auth_login') + if not odoo.tools.config['list_db']: + values['disable_database_manager'] = True + response = request.render('web.login', values) + response.headers['X-Frame-Options'] = 'DENY' + return response diff --git a/restrict_logins/data/ir_cron_data.xml b/restrict_logins/data/ir_cron_data.xml new file mode 100644 index 000000000..dbe858ba9 --- /dev/null +++ b/restrict_logins/data/ir_cron_data.xml @@ -0,0 +1,17 @@ + + + + + + User: Validate User Sessions + + code + model._validate_sessions() + 1 + minutes + -1 + + + + + diff --git a/restrict_logins/doc/RELEASE_NOTES.md b/restrict_logins/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..eef5dc226 --- /dev/null +++ b/restrict_logins/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 07.12.2023 +#### Version 14.0.1.0.0 +##### ADD +- Initial Commit for Restrict Concurrent User Login diff --git a/restrict_logins/models/__init__.py b/restrict_logins/models/__init__.py new file mode 100644 index 000000000..7b4f349a4 --- /dev/null +++ b/restrict_logins/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import res_users +from . import ir_http diff --git a/restrict_logins/models/ir_http.py b/restrict_logins/models/ir_http.py new file mode 100644 index 000000000..d41f45a80 --- /dev/null +++ b/restrict_logins/models/ir_http.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +import logging +from datetime import datetime, timedelta + +import werkzeug +import werkzeug.exceptions +import werkzeug.routing + +from odoo import http, models, SUPERUSER_ID +from odoo.exceptions import AccessDenied +from odoo.http import request + +_logger = logging.getLogger(__name__) + + +class IrHttp(models.AbstractModel): + """ Extends the Odoo abstract model 'ir.http' for custom HTTP handling. """ + _inherit = 'ir.http' + + @classmethod + def _authenticate(cls, endpoint): + """ + This method updates user session details, checks for session mismatches + and performs necessary updates. + """ + auth_method = endpoint.routing["auth"] + if request._is_cors_preflight(endpoint): + auth_method = 'none' + try: + if request.session.uid: + uid = request.session.uid + user_pool = request.env['res.users'].with_user( + SUPERUSER_ID).browse(uid) + + def _update_user(u_sid, u_now, u_exp_date, u_uid): + """ + Function for updating session details for the corresponding + user. + """ + if u_uid and u_exp_date and u_sid and u_now: + query = """update res_users set sid = '%s', + last_update = '%s',exp_date = '%s', + logged_in = 'TRUE' where id = %s + """ % (u_sid, u_now, u_exp_date, u_uid) + request.env.cr.execute(query) + sid = request.session.sid + last_update = user_pool.last_update + now = datetime.now() + exp_date = datetime.now() + timedelta(minutes=45) + # Check that the authentication contains bus_inactivity + request_params = request.params.copy() + if 'options' in request_params and 'bus_inactivity' in \ + request_params['options']: + # Update session if there is sid mismatch + if uid and user_pool.sid and sid != user_pool.sid: + _update_user(sid, now, exp_date, uid) + else: + # Update if there is no session data and user is active + if not user_pool.last_update and not user_pool.sid and \ + not user_pool.logged_in: + _update_user(sid, now, exp_date, uid) + # Update sid and date if last update is above 0.5 min + if last_update: + update_diff = (datetime.now() - + last_update).total_seconds() / 60.0 + if uid and (update_diff > 0.5 or sid != user_pool.sid): + _update_user(sid, now, exp_date, uid) + except Exception as e: + _logger.info("Exception during updating user session...%s", e) + pass + try: + if request.session.uid: + try: + request.session.check_security() + # What if error in security.check() + # -> res_users.check() + # -> res_users._check_credentials() + except (AccessDenied, http.SessionExpiredException): + # All other exceptions mean undetermined status + # (e.g.connection pool full), let them bubble up + request.session.logout(keep_db=True) + if request.uid is None: + getattr(cls, "_auth_method_%s" % auth_method)() + except (AccessDenied, http.SessionExpiredException, + werkzeug.exceptions.HTTPException): + raise + except Exception: + _logger.info("Exception during request Authentication.", + exc_info=True) + raise AccessDenied() + return auth_method diff --git a/restrict_logins/models/res_users.py b/restrict_logins/models/res_users.py new file mode 100644 index 000000000..53c44de64 --- /dev/null +++ b/restrict_logins/models/res_users.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import logging +from datetime import datetime, timedelta + +import pytz + +from odoo import SUPERUSER_ID +from odoo import api, fields, models +from odoo.exceptions import AccessDenied +from odoo.http import request +from ..controllers.main import clear_session_history + +_logger = logging.getLogger(__name__) + + +class ResUsers(models.Model): + """ Inheriting 'res.users' for adding fields related session. """ + _inherit = 'res.users' + + sid = fields.Char(string='Session ID', help="ID of session") + exp_date = fields.Datetime(string='Current Session Expiration', + help="Time of expiring of current session") + logged_in = fields.Boolean(string='Logged In', + help="User is currently logged in") + last_update = fields.Datetime(string="Last Connection", + help="Last log in") + + @classmethod + def _login(cls, db, login, password, user_agent_env): + """ + Handles user login authentication. + Notify user if they are already logged in and attempt to log in from + other device. + """ + if not password: + raise AccessDenied() + ip = request.httprequest.environ['REMOTE_ADDR'] if request else 'n/a' + try: + with cls.pool.cursor() as cr: + self = api.Environment(cr, SUPERUSER_ID, {})[cls._name] + with self._assert_can_auth(): + user = self.search(self._get_login_domain(login), + order=self._get_login_order(), limit=1) + if not user: + raise AccessDenied() + user = user.with_user(user) + user._check_credentials(password, user_agent_env) + tz = request.httprequest.cookies.get( + 'tz') if request else None + if tz in pytz.all_timezones and ( + not user.tz or not user.login_date): + user.tz = tz + # Check sid and exp date + if user.exp_date and user.sid and user.logged_in: + _logger.warning("User %s is already logged in " + "into the system!. Multiple " + "sessions are not allowed for " + "security reasons!" % user.name) + request.uid = user.id + raise AccessDenied("already_logged_in") + # Save user session detail if login is successful + user._save_session() + user._update_last_login() + except AccessDenied: + _logger.info("Login failed for db:%s login:%s from %s", db, login, + ip) + raise + _logger.info("Login successful for db:%s login:%s from %s", db, login, + ip) + return user.id + + def _clear_session(self): + """ Function for clearing the session details of user. """ + self.write({'sid': False, 'exp_date': False, 'logged_in': False, + 'last_update': datetime.now()}) + + def _save_session(self): + """ Function for saving session details of the corresponding user. """ + exp_date = datetime.utcnow() + timedelta(minutes=45) + sid = request.httprequest.session.sid + self.with_user(SUPERUSER_ID).write({'sid': sid, 'exp_date': exp_date, + 'logged_in': True, + 'last_update': datetime.now()}) + + def _validate_sessions(self): + """ Function for validating user sessions. """ + users = self.search([('exp_date', '!=', False)]) + for user in users: + if user.exp_date < datetime.utcnow(): + # Clear session for the user + session_cleared = clear_session_history(user.sid) + if session_cleared: + # Clear user session + user._clear_session() + _logger.info("Cron _validate_session: " + "cleared session user: %s" % (user.name)) + else: + _logger.info("Cron _validate_session: failed to " + "clear session user: %s" % (user.name)) diff --git a/restrict_logins/static/description/assets/icons/check.png b/restrict_logins/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/restrict_logins/static/description/assets/icons/check.png differ diff --git a/restrict_logins/static/description/assets/icons/chevron.png b/restrict_logins/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/restrict_logins/static/description/assets/icons/chevron.png differ diff --git a/restrict_logins/static/description/assets/icons/cogs.png b/restrict_logins/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/restrict_logins/static/description/assets/icons/cogs.png differ diff --git a/restrict_logins/static/description/assets/icons/consultation.png b/restrict_logins/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/restrict_logins/static/description/assets/icons/consultation.png differ diff --git a/restrict_logins/static/description/assets/icons/ecom-black.png b/restrict_logins/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/restrict_logins/static/description/assets/icons/ecom-black.png differ diff --git a/restrict_logins/static/description/assets/icons/education-black.png b/restrict_logins/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/restrict_logins/static/description/assets/icons/education-black.png differ diff --git a/restrict_logins/static/description/assets/icons/hotel-black.png b/restrict_logins/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/restrict_logins/static/description/assets/icons/hotel-black.png differ diff --git a/restrict_logins/static/description/assets/icons/license.png b/restrict_logins/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/restrict_logins/static/description/assets/icons/license.png differ diff --git a/restrict_logins/static/description/assets/icons/lifebuoy.png b/restrict_logins/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/restrict_logins/static/description/assets/icons/lifebuoy.png differ diff --git a/restrict_logins/static/description/assets/icons/logo.png b/restrict_logins/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/restrict_logins/static/description/assets/icons/logo.png differ diff --git a/restrict_logins/static/description/assets/icons/manufacturing-black.png b/restrict_logins/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/restrict_logins/static/description/assets/icons/manufacturing-black.png differ diff --git a/restrict_logins/static/description/assets/icons/pos-black.png b/restrict_logins/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/restrict_logins/static/description/assets/icons/pos-black.png differ diff --git a/restrict_logins/static/description/assets/icons/puzzle.png b/restrict_logins/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/restrict_logins/static/description/assets/icons/puzzle.png differ diff --git a/restrict_logins/static/description/assets/icons/restaurant-black.png b/restrict_logins/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/restrict_logins/static/description/assets/icons/restaurant-black.png differ diff --git a/restrict_logins/static/description/assets/icons/service-black.png b/restrict_logins/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/restrict_logins/static/description/assets/icons/service-black.png differ diff --git a/restrict_logins/static/description/assets/icons/trading-black.png b/restrict_logins/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/restrict_logins/static/description/assets/icons/trading-black.png differ diff --git a/restrict_logins/static/description/assets/icons/training.png b/restrict_logins/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/restrict_logins/static/description/assets/icons/training.png differ diff --git a/restrict_logins/static/description/assets/icons/update.png b/restrict_logins/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/restrict_logins/static/description/assets/icons/update.png differ diff --git a/restrict_logins/static/description/assets/icons/user.png b/restrict_logins/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/restrict_logins/static/description/assets/icons/user.png differ diff --git a/restrict_logins/static/description/assets/icons/wrench.png b/restrict_logins/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/restrict_logins/static/description/assets/icons/wrench.png differ diff --git a/restrict_logins/static/description/assets/misc/categories.png b/restrict_logins/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/restrict_logins/static/description/assets/misc/categories.png differ diff --git a/restrict_logins/static/description/assets/misc/check-box.png b/restrict_logins/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/restrict_logins/static/description/assets/misc/check-box.png differ diff --git a/restrict_logins/static/description/assets/misc/compass.png b/restrict_logins/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/restrict_logins/static/description/assets/misc/compass.png differ diff --git a/restrict_logins/static/description/assets/misc/corporate.png b/restrict_logins/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/restrict_logins/static/description/assets/misc/corporate.png differ diff --git a/restrict_logins/static/description/assets/misc/customer-support.png b/restrict_logins/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/restrict_logins/static/description/assets/misc/customer-support.png differ diff --git a/restrict_logins/static/description/assets/misc/cybrosys-logo.png b/restrict_logins/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/restrict_logins/static/description/assets/misc/cybrosys-logo.png differ diff --git a/restrict_logins/static/description/assets/misc/features.png b/restrict_logins/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/restrict_logins/static/description/assets/misc/features.png differ diff --git a/restrict_logins/static/description/assets/misc/logo.png b/restrict_logins/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/restrict_logins/static/description/assets/misc/logo.png differ diff --git a/restrict_logins/static/description/assets/misc/pictures.png b/restrict_logins/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/restrict_logins/static/description/assets/misc/pictures.png differ diff --git a/restrict_logins/static/description/assets/misc/pie-chart.png b/restrict_logins/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/restrict_logins/static/description/assets/misc/pie-chart.png differ diff --git a/restrict_logins/static/description/assets/misc/right-arrow.png b/restrict_logins/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/restrict_logins/static/description/assets/misc/right-arrow.png differ diff --git a/restrict_logins/static/description/assets/misc/star.png b/restrict_logins/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/restrict_logins/static/description/assets/misc/star.png differ diff --git a/restrict_logins/static/description/assets/misc/support.png b/restrict_logins/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/restrict_logins/static/description/assets/misc/support.png differ diff --git a/restrict_logins/static/description/assets/misc/whatsapp.png b/restrict_logins/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/restrict_logins/static/description/assets/misc/whatsapp.png differ diff --git a/restrict_logins/static/description/assets/modules/custom_gantt_view.png b/restrict_logins/static/description/assets/modules/custom_gantt_view.png new file mode 100644 index 000000000..8abd2bd4a Binary files /dev/null and b/restrict_logins/static/description/assets/modules/custom_gantt_view.png differ diff --git a/restrict_logins/static/description/assets/modules/customer_route_management.png b/restrict_logins/static/description/assets/modules/customer_route_management.png new file mode 100644 index 000000000..02d34ea85 Binary files /dev/null and b/restrict_logins/static/description/assets/modules/customer_route_management.png differ diff --git a/restrict_logins/static/description/assets/modules/login_user_detail.png b/restrict_logins/static/description/assets/modules/login_user_detail.png new file mode 100644 index 000000000..00caa63de Binary files /dev/null and b/restrict_logins/static/description/assets/modules/login_user_detail.png differ diff --git a/restrict_logins/static/description/assets/modules/odoo11_magento2.png b/restrict_logins/static/description/assets/modules/odoo11_magento2.png new file mode 100644 index 000000000..3d6d9b8d5 Binary files /dev/null and b/restrict_logins/static/description/assets/modules/odoo11_magento2.png differ diff --git a/restrict_logins/static/description/assets/modules/odoo_dynamic_dashboard.png b/restrict_logins/static/description/assets/modules/odoo_dynamic_dashboard.png new file mode 100644 index 000000000..e21929e82 Binary files /dev/null and b/restrict_logins/static/description/assets/modules/odoo_dynamic_dashboard.png differ diff --git a/restrict_logins/static/description/assets/modules/whatsapp_redirect.png b/restrict_logins/static/description/assets/modules/whatsapp_redirect.png new file mode 100644 index 000000000..acd07d244 Binary files /dev/null and b/restrict_logins/static/description/assets/modules/whatsapp_redirect.png differ diff --git a/restrict_logins/static/description/assets/screenshots/1.png b/restrict_logins/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..661d0b7fd Binary files /dev/null and b/restrict_logins/static/description/assets/screenshots/1.png differ diff --git a/restrict_logins/static/description/assets/screenshots/2.png b/restrict_logins/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..cbcc25878 Binary files /dev/null and b/restrict_logins/static/description/assets/screenshots/2.png differ diff --git a/restrict_logins/static/description/assets/screenshots/3.png b/restrict_logins/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..84d2fa306 Binary files /dev/null and b/restrict_logins/static/description/assets/screenshots/3.png differ diff --git a/restrict_logins/static/description/assets/screenshots/hero.gif b/restrict_logins/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..779737032 Binary files /dev/null and b/restrict_logins/static/description/assets/screenshots/hero.gif differ diff --git a/restrict_logins/static/description/banner.png b/restrict_logins/static/description/banner.png new file mode 100644 index 000000000..a4aa5ad60 Binary files /dev/null and b/restrict_logins/static/description/banner.png differ diff --git a/restrict_logins/static/description/icon.png b/restrict_logins/static/description/icon.png new file mode 100644 index 000000000..c87bdbe7f Binary files /dev/null and b/restrict_logins/static/description/icon.png differ diff --git a/restrict_logins/static/description/index.html b/restrict_logins/static/description/index.html new file mode 100644 index 000000000..113c9315f --- /dev/null +++ b/restrict_logins/static/description/index.html @@ -0,0 +1,583 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +
+

+ Restrict Concurrent User Login

+

+ Restrict Concurrent Sessions

+ + +
+
+ + +
+
+ +
+

+ Explore This Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module is designed to enhance security by restricting users from having + multiple concurrent logins. If a user is already logged in on one device, + they will be prevented from logging in on another. Additionally, the module + offers the capability to force logout for users. Inactive sessions will + automatically expire after 45 minutes, further enhancing security measures. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Restrict Concurrent Sessions for Users +

+ Restrict Concurrent Sessions to enhance security.

+
+
+ + Force User Logout +

+ Option to log out from all logged in devices.

+
+
+ + Automatic Session Expiration +

+ Automatic Session Expiration After 45 Minutes.

+
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Log in to Odoo

+

+ After installation, Log in to Odoo.

+ +
+
+

+ Alert When the User is Logged in from Additional Devices.

+

+ When attempting to Log in, a notification will appear if the user is already logged in.

+ +
+
+

+ Option for Forced Logout.

+

+ Enable the ability to force logout from devices that are already logged in.

+ +
+
+
+ + + +
+
+ +
+

+ Related Products +

+
+
+
+ +
+
+ + + +
+
+ +
+

+ Our Services +

+
+
+
+
+
+ +
+
+ Odoo Customization
+
+
+
+ +
+
+ Odoo Implementation
+
+
+
+ +
+
+ Odoo Support
+
+
+
+ +
+
+ Hire Odoo Developer
+
+
+
+ +
+
+ Odoo Integration
+
+
+
+ +
+
+ Odoo Migration
+
+
+
+ +
+
+ Odoo Consultancy
+
+
+
+ +
+
+ Odoo Implementation
+
+
+
+ +
+
+ Odoo Licensing Consultancy
+
+
+
+ + + +
+
+ +
+

+ Our Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure and sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy configuration and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and schedule your operations

+
+
+
+
+ +
+ E-commerce & Website +
+

+ Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An all-inclusive hotel management application

+
+
+
+
+ + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/restrict_logins/views/login_clear_session_template.xml b/restrict_logins/views/login_clear_session_template.xml new file mode 100644 index 000000000..be468942f --- /dev/null +++ b/restrict_logins/views/login_clear_session_template.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/restrict_logins/views/res_users_views.xml b/restrict_logins/views/res_users_views.xml new file mode 100644 index 000000000..ec03d997c --- /dev/null +++ b/restrict_logins/views/res_users_views.xml @@ -0,0 +1,17 @@ + + + + + res.users.view.tree.inherit.restrict.logins + res.users + + + + + + + + + + +