diff --git a/user_password_strength/README.rst b/user_password_strength/README.rst new file mode 100644 index 000000000..c0dea510c --- /dev/null +++ b/user_password_strength/README.rst @@ -0,0 +1,44 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +User Password Strength - Restrict Weak Password +============================================== +This module helps you to restrict weak password in user signup form. + +Configuration +============= +* No additional configurations needed +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: (V17) Farha V C + (V18) Ashwin T + + +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/user_password_strength/__init__.py b/user_password_strength/__init__.py new file mode 100644 index 000000000..e7170b38d --- /dev/null +++ b/user_password_strength/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ashwin T () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/user_password_strength/__manifest__.py b/user_password_strength/__manifest__.py new file mode 100644 index 000000000..9376812c5 --- /dev/null +++ b/user_password_strength/__manifest__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ashwin T () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +{ + 'name': "User Password Strength - Restrict Weak Password", + 'version': "18.0.1.0.0", + 'summary': """ User password strength - restrict weak password""", + 'description': """ Customized setting to restrict weak password which is + completely configurable. Also, allows the preset password strength checkup + while resetting.""", + 'author': "Cybrosys Techno Solutions", + 'company': "Cybrosys Techno Solutions", + 'maintainer': "Cybrosys Techno Solutions", + 'website': "https://cybrosys.com/", + 'category': 'Tools', + 'depends': ['base', 'website'], + 'data': [ + 'views/signup_page_view.xml', + 'views/restrict_password.xml', + ], + 'images': ['static/description/banner.png'], + 'assets': { + 'web.assets_frontend': ['user_password_strength/static/src/js/signup_user.js', ], + }, + 'license': "AGPL-3", + 'installable': True, + 'auto_install': True, + 'application': False +} diff --git a/user_password_strength/controllers/__init__.py b/user_password_strength/controllers/__init__.py new file mode 100644 index 000000000..ec29bf4a2 --- /dev/null +++ b/user_password_strength/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ashwin T () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import main diff --git a/user_password_strength/controllers/main.py b/user_password_strength/controllers/main.py new file mode 100644 index 000000000..a5ae7d435 --- /dev/null +++ b/user_password_strength/controllers/main.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ashwin T () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import http, _ +from odoo.addons.web.controllers.home import Home, LOGIN_SUCCESSFUL_PARAMS +from odoo.exceptions import UserError +from odoo.http import request +import re +LOGIN_SUCCESSFUL_PARAMS.add('account_created') + + +class PasswordSecurity(Home): + """overriding the website signup controller""" + def _prepare_signup_values(self, qcontext): + """getting the values from config settings""" + values = {key: qcontext.get(key) for key in ('login', 'name', + 'password')} + get_param = request.env['ir.config_parameter'].sudo().get_param + config_strength = get_param('user_password_strength.is_strength') + config_digit = get_param('user_password_strength.is_digit') + config_upper = get_param('user_password_strength.is_upper') + config_lower = get_param('user_password_strength.is_lower') + config_special_symbol = get_param('user_password_strength' + '.is_special_symbol') + + if not values: + raise UserError(_("The form was not properly filled in.")) + if values.get('password') != qcontext.get('confirm_password'): + raise UserError(_("Passwords do not match; please retype them.")) + if values.get('password'): + current_password = str(values.get('password')) + if config_strength and (len(current_password) < 8): + raise UserError(_("*****The Password Should have 8 characters." + "")) + else: + if config_digit and (re.search('[0-9]', current_password) + is None): + raise UserError(_( + "*****The Password Should have at least one number.")) + if config_upper and (re.search('[A-Z]', current_password) + is None): + raise UserError(_( + "*****The Password Should have at least " + "one uppercase character.")) + if config_lower and (re.search("[a-z]", current_password) + is None): + raise UserError(_( + "*****The Password Should have at least one " + "lowercase character.")) + if config_special_symbol and \ + (re.search("[~!@#$%^&*]", current_password) is None): + raise UserError(_( + "*****The Password Should have at least " + "one special symbol.")) + return super()._prepare_signup_values(qcontext) + + @http.route('/web/config_params', type='json', auth="public") + def website_get_config_value(self): + """returning the values from config settings to js""" + get_param = request.env['ir.config_parameter'].sudo().get_param + return { + 'config_strength': get_param('user_password_strength.is_strength'), + 'config_digit': get_param('user_password_strength.is_digit'), + 'config_upper': get_param('user_password_strength.is_upper'), + 'config_lower': get_param('user_password_strength.is_lower'), + 'config_special_symbol': get_param('user_password_strength' + '.is_special_symbol') + } diff --git a/user_password_strength/doc/RELEASE_NOTES.md b/user_password_strength/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..70ae1fc63 --- /dev/null +++ b/user_password_strength/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 16.10.2024 +#### Version 18.0.1.0.0 +#### ADD + +- Initial Commit for User Password Strength - Restrict Weak Password diff --git a/user_password_strength/models/__init__.py b/user_password_strength/models/__init__.py new file mode 100644 index 000000000..3aba78fb0 --- /dev/null +++ b/user_password_strength/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ashwin T () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import restrict_password +from . import change_password_user diff --git a/user_password_strength/models/change_password_user.py b/user_password_strength/models/change_password_user.py new file mode 100644 index 000000000..4abfc0203 --- /dev/null +++ b/user_password_strength/models/change_password_user.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ashwin T () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, _ +import re +from odoo.exceptions import UserError +from odoo.http import request + + +class ChangePasswordUser(models.TransientModel): + """ Inherited model to configure users in the change password wizard. """ + _inherit = 'change.password.user' + + def change_password_button(self): + """Overriding the password reset function""" + for line in self: + get_param = request.env['ir.config_parameter'].sudo().get_param + config_strength = get_param( + 'user_password_strength.is_strength') + config_digit = get_param('user_password_strength.is_digit') + config_upper = get_param('user_password_strength.is_upper') + config_lower = get_param('user_password_strength.is_lower') + config_special_symbol = get_param('user_password_strength' + '.is_special_symbol') + if line.new_passwd: + current_password = line.new_passwd + if config_strength and (len(current_password) < 8): + raise UserError( + _("*****The Password Should have 8 characters." + "")) + else: + if config_digit and ( + re.search('[0-9]', current_password) + is None): + raise UserError(_( + "*****The Password Should have at least one " + "number.")) + if config_upper and ( + re.search('[A-Z]', current_password) + is None): + raise UserError(_( + "*****The Password Should have at least " + "one uppercase character.")) + if config_lower and ( + re.search("[a-z]", current_password) + is None): + raise UserError(_( + "*****The Password Should have at least one " + "lowercase character.")) + if config_special_symbol and \ + (re.search("[~!@#$%^&*]", + current_password) is None): + raise UserError(_( + "*****The Password Should have at least " + "one special symbol.")) + line.user_id._change_password(line.new_passwd) + else: + if (not config_strength and not + config_digit and not config_upper and not + config_lower and not config_special_symbol): + # don't keep temporary passwords in the database longer + # than necessary + self.write({'new_passwd': False}) + else: + raise UserError(_("The password cannot be empty.")) diff --git a/user_password_strength/models/restrict_password.py b/user_password_strength/models/restrict_password.py new file mode 100644 index 000000000..115d27a5f --- /dev/null +++ b/user_password_strength/models/restrict_password.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ashwin T () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class ConfSettings(models.TransientModel): + """inheriting configuration settings.""" + _inherit = "res.config.settings" + + user_password_restrict = fields.Boolean(string="Restrict User Password", + help="Tick this to enable password" + "restriction", default=True) + is_strength = fields.Boolean(string="Should have 8 characters", + help="Enable this to check for 8 characters", + config_parameter='user_password_strength.' + 'is_strength') + is_digit = fields.Boolean(string="Should have at least one number", + help="Enable this to check for at least a digit", + config_parameter='user_password_strength.' + 'is_digit') + is_upper = fields.Boolean(string="Should have at least one uppercase", + help="Enable this to check for uppercase letter", + config_parameter='user_password_strength.' + 'is_upper') + is_lower = fields.Boolean(string="Should have at least one " + "lowercase character", + help="Enable this to check for lowercase letter", + config_parameter='user_password_strength.' + 'is_lower') + is_special_symbol = fields.Boolean(string="Should have at least one " + "special symbol", + help="Enable this to check for " + "special symbol", + config_parameter='user_password_strength' + '.is_special_symbol') diff --git a/user_password_strength/static/description/assets/icons/arrows-repeat.svg b/user_password_strength/static/description/assets/icons/arrows-repeat.svg new file mode 100755 index 000000000..1d7efabc5 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/banner-1.png b/user_password_strength/static/description/assets/icons/banner-1.png new file mode 100755 index 000000000..c180db172 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/banner-1.png differ diff --git a/user_password_strength/static/description/assets/icons/banner-2.svg b/user_password_strength/static/description/assets/icons/banner-2.svg new file mode 100755 index 000000000..e606d97d9 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/banner-bg.png b/user_password_strength/static/description/assets/icons/banner-bg.png new file mode 100755 index 000000000..a8238d3c0 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/banner-bg.png differ diff --git a/user_password_strength/static/description/assets/icons/banner-bg.svg b/user_password_strength/static/description/assets/icons/banner-bg.svg new file mode 100755 index 000000000..b1378103e --- /dev/null +++ b/user_password_strength/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/banner-call.svg b/user_password_strength/static/description/assets/icons/banner-call.svg new file mode 100755 index 000000000..96c687e81 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/user_password_strength/static/description/assets/icons/banner-mail.svg b/user_password_strength/static/description/assets/icons/banner-mail.svg new file mode 100755 index 000000000..cbf0d158d --- /dev/null +++ b/user_password_strength/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/user_password_strength/static/description/assets/icons/banner-pattern.svg b/user_password_strength/static/description/assets/icons/banner-pattern.svg new file mode 100755 index 000000000..9c1c7e101 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/banner-promo.svg b/user_password_strength/static/description/assets/icons/banner-promo.svg new file mode 100755 index 000000000..d52791b11 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/brand-pair.svg b/user_password_strength/static/description/assets/icons/brand-pair.svg new file mode 100755 index 000000000..d8db7fc1e --- /dev/null +++ b/user_password_strength/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/check.png b/user_password_strength/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/user_password_strength/static/description/assets/icons/check.png differ diff --git a/user_password_strength/static/description/assets/icons/chevron.png b/user_password_strength/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/chevron.png differ diff --git a/user_password_strength/static/description/assets/icons/close-icon.svg b/user_password_strength/static/description/assets/icons/close-icon.svg new file mode 100755 index 000000000..df8cce37a --- /dev/null +++ b/user_password_strength/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/user_password_strength/static/description/assets/icons/cogs.png b/user_password_strength/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/cogs.png differ diff --git a/user_password_strength/static/description/assets/icons/collabarate-icon.svg b/user_password_strength/static/description/assets/icons/collabarate-icon.svg new file mode 100755 index 000000000..dd4e10518 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/user_password_strength/static/description/assets/icons/consultation.png b/user_password_strength/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/user_password_strength/static/description/assets/icons/consultation.png differ diff --git a/user_password_strength/static/description/assets/icons/cybro-logo.png b/user_password_strength/static/description/assets/icons/cybro-logo.png new file mode 100755 index 000000000..ff4b78220 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/cybro-logo.png differ diff --git a/user_password_strength/static/description/assets/icons/down.svg b/user_password_strength/static/description/assets/icons/down.svg new file mode 100755 index 000000000..f21c36271 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/user_password_strength/static/description/assets/icons/ecom-black.png b/user_password_strength/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/ecom-black.png differ diff --git a/user_password_strength/static/description/assets/icons/education-black.png b/user_password_strength/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/user_password_strength/static/description/assets/icons/education-black.png differ diff --git a/user_password_strength/static/description/assets/icons/faq.png b/user_password_strength/static/description/assets/icons/faq.png new file mode 100755 index 000000000..4250b5b81 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/faq.png differ diff --git a/user_password_strength/static/description/assets/icons/feature-icon.svg b/user_password_strength/static/description/assets/icons/feature-icon.svg new file mode 100755 index 000000000..fa0ea6850 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/feature.png b/user_password_strength/static/description/assets/icons/feature.png new file mode 100755 index 000000000..ac7a785c0 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/feature.png differ diff --git a/user_password_strength/static/description/assets/icons/gear.svg b/user_password_strength/static/description/assets/icons/gear.svg new file mode 100755 index 000000000..0cc66b6ea --- /dev/null +++ b/user_password_strength/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/hero.gif b/user_password_strength/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..be51d4f00 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/hero.gif differ diff --git a/user_password_strength/static/description/assets/icons/hire-odoo.svg b/user_password_strength/static/description/assets/icons/hire-odoo.svg new file mode 100755 index 000000000..e1ac089b0 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/hotel-black.png b/user_password_strength/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/user_password_strength/static/description/assets/icons/hotel-black.png differ diff --git a/user_password_strength/static/description/assets/icons/license.png b/user_password_strength/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/user_password_strength/static/description/assets/icons/license.png differ diff --git a/user_password_strength/static/description/assets/icons/life-ring-icon.svg b/user_password_strength/static/description/assets/icons/life-ring-icon.svg new file mode 100755 index 000000000..3ae6e1d89 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/lifebuoy.png b/user_password_strength/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/user_password_strength/static/description/assets/icons/lifebuoy.png differ diff --git a/user_password_strength/static/description/assets/icons/logo.png b/user_password_strength/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/user_password_strength/static/description/assets/icons/logo.png differ diff --git a/user_password_strength/static/description/assets/icons/mail.svg b/user_password_strength/static/description/assets/icons/mail.svg new file mode 100755 index 000000000..1eedde695 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/user_password_strength/static/description/assets/icons/manufacturing-black.png b/user_password_strength/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/user_password_strength/static/description/assets/icons/manufacturing-black.png differ diff --git a/user_password_strength/static/description/assets/icons/notes.png b/user_password_strength/static/description/assets/icons/notes.png new file mode 100755 index 000000000..ee5e95404 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/notes.png differ diff --git a/user_password_strength/static/description/assets/icons/notification icon.svg b/user_password_strength/static/description/assets/icons/notification icon.svg new file mode 100755 index 000000000..053189973 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/odoo-consultancy.svg b/user_password_strength/static/description/assets/icons/odoo-consultancy.svg new file mode 100755 index 000000000..e05f65bde --- /dev/null +++ b/user_password_strength/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/user_password_strength/static/description/assets/icons/odoo-licencing.svg b/user_password_strength/static/description/assets/icons/odoo-licencing.svg new file mode 100755 index 000000000..2606c88b0 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/user_password_strength/static/description/assets/icons/odoo-logo.png b/user_password_strength/static/description/assets/icons/odoo-logo.png new file mode 100755 index 000000000..0e4d0eb5a Binary files /dev/null and b/user_password_strength/static/description/assets/icons/odoo-logo.png differ diff --git a/user_password_strength/static/description/assets/icons/patter.svg b/user_password_strength/static/description/assets/icons/patter.svg new file mode 100755 index 000000000..25c9c0a8f --- /dev/null +++ b/user_password_strength/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/pattern1.png b/user_password_strength/static/description/assets/icons/pattern1.png new file mode 100755 index 000000000..09ab0fb2d Binary files /dev/null and b/user_password_strength/static/description/assets/icons/pattern1.png differ diff --git a/user_password_strength/static/description/assets/icons/pos-black.png b/user_password_strength/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/pos-black.png differ diff --git a/user_password_strength/static/description/assets/icons/puzzle-piece-icon.svg b/user_password_strength/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100755 index 000000000..3e9ad9373 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/puzzle.png b/user_password_strength/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/puzzle.png differ diff --git a/user_password_strength/static/description/assets/icons/replace-icon.svg b/user_password_strength/static/description/assets/icons/replace-icon.svg new file mode 100755 index 000000000..d0e3a7af1 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/restaurant-black.png b/user_password_strength/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/restaurant-black.png differ diff --git a/user_password_strength/static/description/assets/icons/screenshot-main.png b/user_password_strength/static/description/assets/icons/screenshot-main.png new file mode 100755 index 000000000..575f8e676 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/screenshot-main.png differ diff --git a/user_password_strength/static/description/assets/icons/screenshot.png b/user_password_strength/static/description/assets/icons/screenshot.png new file mode 100755 index 000000000..cef272529 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/screenshot.png differ diff --git a/user_password_strength/static/description/assets/icons/service-black.png b/user_password_strength/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/user_password_strength/static/description/assets/icons/service-black.png differ diff --git a/user_password_strength/static/description/assets/icons/skype-fill.svg b/user_password_strength/static/description/assets/icons/skype-fill.svg new file mode 100755 index 000000000..c17423639 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/skype.png b/user_password_strength/static/description/assets/icons/skype.png new file mode 100755 index 000000000..51b409fb3 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/skype.png differ diff --git a/user_password_strength/static/description/assets/icons/skype.svg b/user_password_strength/static/description/assets/icons/skype.svg new file mode 100755 index 000000000..df3dad39b --- /dev/null +++ b/user_password_strength/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/user_password_strength/static/description/assets/icons/star-1.svg b/user_password_strength/static/description/assets/icons/star-1.svg new file mode 100755 index 000000000..7e55ab162 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/star-2.svg b/user_password_strength/static/description/assets/icons/star-2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/user_password_strength/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/support.png b/user_password_strength/static/description/assets/icons/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/support.png differ diff --git a/user_password_strength/static/description/assets/icons/test-1 - Copy.png b/user_password_strength/static/description/assets/icons/test-1 - Copy.png new file mode 100755 index 000000000..f6a902663 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/test-1 - Copy.png differ diff --git a/user_password_strength/static/description/assets/icons/test-1.png b/user_password_strength/static/description/assets/icons/test-1.png new file mode 100755 index 000000000..0908add2b Binary files /dev/null and b/user_password_strength/static/description/assets/icons/test-1.png differ diff --git a/user_password_strength/static/description/assets/icons/test-2.png b/user_password_strength/static/description/assets/icons/test-2.png new file mode 100755 index 000000000..4671fe91e Binary files /dev/null and b/user_password_strength/static/description/assets/icons/test-2.png differ diff --git a/user_password_strength/static/description/assets/icons/trading-black.png b/user_password_strength/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/trading-black.png differ diff --git a/user_password_strength/static/description/assets/icons/training.png b/user_password_strength/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/user_password_strength/static/description/assets/icons/training.png differ diff --git a/user_password_strength/static/description/assets/icons/translate.svg b/user_password_strength/static/description/assets/icons/translate.svg new file mode 100755 index 000000000..af9c8a1aa --- /dev/null +++ b/user_password_strength/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/update.png b/user_password_strength/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/user_password_strength/static/description/assets/icons/update.png differ diff --git a/user_password_strength/static/description/assets/icons/user.png b/user_password_strength/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/user_password_strength/static/description/assets/icons/user.png differ diff --git a/user_password_strength/static/description/assets/icons/video.png b/user_password_strength/static/description/assets/icons/video.png new file mode 100755 index 000000000..576705b17 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/video.png differ diff --git a/user_password_strength/static/description/assets/icons/whatsapp.png b/user_password_strength/static/description/assets/icons/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/user_password_strength/static/description/assets/icons/whatsapp.png differ diff --git a/user_password_strength/static/description/assets/icons/wrench-icon.svg b/user_password_strength/static/description/assets/icons/wrench-icon.svg new file mode 100755 index 000000000..174b5a465 --- /dev/null +++ b/user_password_strength/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_password_strength/static/description/assets/icons/wrench.png b/user_password_strength/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/user_password_strength/static/description/assets/icons/wrench.png differ diff --git a/user_password_strength/static/description/assets/modules/1.jpg b/user_password_strength/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..3cb15fe01 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/1.jpg differ diff --git a/user_password_strength/static/description/assets/modules/2.jpg b/user_password_strength/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..662cadcc3 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/2.jpg differ diff --git a/user_password_strength/static/description/assets/modules/3.jpg b/user_password_strength/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..717a00443 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/3.jpg differ diff --git a/user_password_strength/static/description/assets/modules/4.png b/user_password_strength/static/description/assets/modules/4.png new file mode 100644 index 000000000..00ebf54ad Binary files /dev/null and b/user_password_strength/static/description/assets/modules/4.png differ diff --git a/user_password_strength/static/description/assets/modules/5.jpg b/user_password_strength/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..7c67e2eec Binary files /dev/null and b/user_password_strength/static/description/assets/modules/5.jpg differ diff --git a/user_password_strength/static/description/assets/modules/6.gif b/user_password_strength/static/description/assets/modules/6.gif new file mode 100644 index 000000000..a35ece8df Binary files /dev/null and b/user_password_strength/static/description/assets/modules/6.gif differ diff --git a/user_password_strength/static/description/assets/screenshots/1.png b/user_password_strength/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..be337c367 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/1.png differ diff --git a/user_password_strength/static/description/assets/screenshots/2.png b/user_password_strength/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..5bb7ee838 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/2.png differ diff --git a/user_password_strength/static/description/assets/screenshots/3.png b/user_password_strength/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..ba3af0413 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/3.png differ diff --git a/user_password_strength/static/description/assets/screenshots/4.png b/user_password_strength/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..0b6f81ae5 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/4.png differ diff --git a/user_password_strength/static/description/assets/screenshots/5.png b/user_password_strength/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..b0ce6772c Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/5.png differ diff --git a/user_password_strength/static/description/assets/screenshots/6.png b/user_password_strength/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..5dbcce72b Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/6.png differ diff --git a/user_password_strength/static/description/assets/screenshots/7.png b/user_password_strength/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..97483d778 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/7.png differ diff --git a/user_password_strength/static/description/banner.png b/user_password_strength/static/description/banner.png new file mode 100644 index 000000000..8dc1556c8 Binary files /dev/null and b/user_password_strength/static/description/banner.png differ diff --git a/user_password_strength/static/description/icon.png b/user_password_strength/static/description/icon.png new file mode 100644 index 000000000..186174c55 Binary files /dev/null and b/user_password_strength/static/description/icon.png differ diff --git a/user_password_strength/static/description/index.html b/user_password_strength/static/description/index.html new file mode 100644 index 000000000..a93d27ca3 --- /dev/null +++ b/user_password_strength/static/description/index.html @@ -0,0 +1,1101 @@ + + + + + + User Password Strength - Restrict Weak Password + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+ +
+
+ +
+
+
+
+

+ This Module Helps User to strength their passwords +

+

User Password Strength - RESTRICT WEAK PASSWORD +

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

Key + Highlights

+
+
+
+
+ +
+
+ Configurable Password Strength +
+

+ This allows to restrict the weak passwords based on five different + types of custom settings which can be configured

+ +
+
+
+
+
+ +
+
+ Gives User Error Warnings +
+

+ This module checks the configured custom conditions every time when the user + sets the password or changes the password from the User form view +

+
+
+
+
+ +
+
+
+ User Password Strength - Restrict Weak Password +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Condition + + Selection +

+
+
+

+ Go to Setting --> Permission --> + Choose any condition in Restricted User Password +

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

+ Choosing + + Customer Account Type +

+
+
+

+ Go to Website --> Settings -->Privacy-->Choose Free Sign Up.
+ So new users can be logged without any invitation +

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

+ Progressbar for + password +

+
+
+

+ Progressbar level would change based on the user password input +

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

+ Warnings on conditions + + (Minimum length 8) +

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

+ Warnings on conditions + + + (At-least one Number) +

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

+ Creation of New Paasword + + + (Stronger One) +

+
+
+

+ Users can create a new password by resetting old one and ensuring it is strong,
+ using a mix of uppercase and lowercase letters, numbers, + and special characters. +

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

+ Stronger Password + + + (satisfies all condition) +

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

+ Password Strength Enforcement.

+
+
+

+ Password policies are enforced every + time a user creates or changes their password in + the User form view or during password reset. + System administrators can customize the + password strength rules to meet organizational security standards. +

+
+ +
+
+
+
+
+
+ +
+

+ Easy Configuration.

+
+
+

+ A simple user interface to configure password rules in the Settings. + No need to modify the user form manually, as it integrates seamlessly into the Odoo backend. +

+
+
+
+
+
+
+
+ +
+

+ Security Compliance.

+
+
+

+ Helps businesses comply with security policies by + ensuring that all users set strong, secure passwords.
+ Prevents the use of weak or easy-to-guess passwords, + enhancing the overall security of the system. +

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

+ You can configure password strength rules by navigating + to the Settings menu in Odoo. From there, + you can define password length, character requirements + (uppercase, lowercase, digits, and special characters), + and other password policies. +

+
+
+ +
+ +
+

+ Yes, the module provides real-time validation. + If a user attempts to set a password that does not meet + the configured requirements, they will receive error warnings, + specifying what criteria are missing. +

+
+
+ +
+ +
+

+ If a user tries to set a password that does + not meet the requirements, they will be prevented from saving it. + A validation error message will inform the user of what needs to be corrected + before the password can be updated. +

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

+ Latest Release 18.0.1.0.0 +

+ + 26th September, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + \ No newline at end of file diff --git a/user_password_strength/static/src/js/signup_user.js b/user_password_strength/static/src/js/signup_user.js new file mode 100644 index 000000000..53bbe9c22 --- /dev/null +++ b/user_password_strength/static/src/js/signup_user.js @@ -0,0 +1,146 @@ +/** @odoo-module **/ + /*Extending the public widget of the signup form for checking the user + password strength conditions on key up function of the password field in + the sign up form,Based on the conditions from configuration settings.*/ + import { rpc } from "@web/core/network/rpc"; + import publicWidget from "@web/legacy/js/public/public_widget"; + var password = document.getElementById("password"); + publicWidget.registry.SignUpFormKeyupChange = publicWidget.Widget.extend({ + selector: '.oe_website_login_container', + events: { + 'input input[type="password"]': '_onPasswordInput', // Using input event instead of keypress + }, + start() { + this._super.apply(this, arguments); + }, + _onPasswordInput: function (ev) { + var passwordInput = ev.currentTarget; // Get the password input field + var current_pwd = passwordInput.value; // Get the current password value + if (current_pwd.length === 0) { + var progressBar = document.getElementById("progress"); + if (progressBar) { + progressBar.value = "0"; + progressBar.style.backgroundColor = "#FF0000"; // Reset to red + } + return; + } + + rpc('/web/config_params',{}).then(function (data) { + var list=[] + for (let x in data) { + list.push(data[x]); + } + var flag = 0 + for(var i=0;i<=list.length;i++){ + if(list[i] == 'True'){ + flag +=1 + } + } + var prog = [/[$@$!%*#?&]/, /[A-Z]/, /[0-9]/, /[a-z]/] + .reduce((memo, test) => memo + test.test(current_pwd), + 0); + if(prog > 2 && current_pwd.length > 7){ + prog++; + } + var progress = ""; + var colors = ['#FF0000', '#00FF00','#0000FF']; + var currentColor = 0; + //When 5 conditions are enabled in config settings + if (flag == 5){ + switch (prog) { + case 0: + case 1: + progress = "20"; + currentColor = colors[0]; + break; + case 2: + progress = "25"; + currentColor = colors[0]; + break; + case 3: + progress = "100"; + currentColor = colors[1]; + break; + case 4: + progress = "75"; + currentColor = colors[1]; + break; + case 5: + progress = "100"; + currentColor = colors[1]; + break; + } + } + //When 4 conditions are enabled in config settings + if (flag == 4){ + switch (prog) { + case 0: + case 1: + case 2: + progress = "25"; + currentColor = colors[0]; + break; + case 3: + progress = "50"; + currentColor = colors[0]; + break; + case 4: + progress = "75"; + currentColor = colors[1]; + break; + case 5: + progress = "100"; + currentColor = colors[1]; + break; + } + } + //When 3 conditions are enabled in config settings + if (flag == 3){ + switch (prog) { + case 0: + case 1: + case 2: + case 3: + progress = "33.33"; + currentColor = colors[0]; + break; + case 4: + progress = "66.66"; + currentColor = colors[1]; + break; + case 5: + progress = "100"; + currentColor = colors[1]; + break; + } + } + + //When 2 conditions are enabled in config settings + if (flag == 2) { + if (prog != 5) { + progress = "50"; + currentColor = colors[0]; + } else{ + progress = "100"; + currentColor = colors[1]; + } + } + //When only 1 condition is enabled in config settings + if (flag == 1){ + progress = "100"; + currentColor = colors[1]; + } + var val = document.getElementById("progress") + if(val!== null){ + document.getElementById("progress").value = progress; + document.getElementById("progress").style + .backgroundColor = currentColor; + } + }); + var current_pwd = password.value + if (current_pwd.length === 0) { + document.getElementById("progress").value = "0"; + return; + } + }, +}); diff --git a/user_password_strength/views/restrict_password.xml b/user_password_strength/views/restrict_password.xml new file mode 100644 index 000000000..98b88895f --- /dev/null +++ b/user_password_strength/views/restrict_password.xml @@ -0,0 +1,52 @@ + + + + + res.config.settings.inherit.view + res.config.settings + + + + +
+
+ +
+
+
+
+
+
+
+
diff --git a/user_password_strength/views/signup_page_view.xml b/user_password_strength/views/signup_page_view.xml new file mode 100644 index 000000000..66e237642 --- /dev/null +++ b/user_password_strength/views/signup_page_view.xml @@ -0,0 +1,14 @@ + + + +