diff --git a/user_password_strength/README.rst b/user_password_strength/README.rst new file mode 100644 index 000000000..07be8ecce --- /dev/null +++ b/user_password_strength/README.rst @@ -0,0 +1,43 @@ +.. image:: https://img.shields.io/badge/licence-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: Farha V C @cybrosys, + version 17: Farha @cybrosys + +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..d32cb9113 --- /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: Farha V C () +# +# 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..764a0a3cc --- /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: Farha V C () +# +# 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", + 'version': "17.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..4545e2395 --- /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: Farha V C () +# +# 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..6ebc31b6a --- /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: Farha V C () +# +# 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..5c750ed2d --- /dev/null +++ b/user_password_strength/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 12.07.2024 +#### Version 17.0.1.0.0 +#### ADD + +- Initial Commit for User Password Strength diff --git a/user_password_strength/models/__init__.py b/user_password_strength/models/__init__.py new file mode 100644 index 000000000..e562396e0 --- /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: Farha V C () +# +# 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..45239417f --- /dev/null +++ b/user_password_strength/models/change_password_user.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Farha V C () +# +# 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..71e60cd88 --- /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: Farha V C () +# +# 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/check.png b/user_password_strength/static/description/assets/icons/check.png new file mode 100644 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 100644 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/cogs.png b/user_password_strength/static/description/assets/icons/cogs.png new file mode 100644 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/consultation.png b/user_password_strength/static/description/assets/icons/consultation.png new file mode 100644 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/ecom-black.png b/user_password_strength/static/description/assets/icons/ecom-black.png new file mode 100644 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 100644 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/hotel-black.png b/user_password_strength/static/description/assets/icons/hotel-black.png new file mode 100644 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 100644 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/lifebuoy.png b/user_password_strength/static/description/assets/icons/lifebuoy.png new file mode 100644 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/manufacturing-black.png b/user_password_strength/static/description/assets/icons/manufacturing-black.png new file mode 100644 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/pos-black.png b/user_password_strength/static/description/assets/icons/pos-black.png new file mode 100644 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.png b/user_password_strength/static/description/assets/icons/puzzle.png new file mode 100644 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/restaurant-black.png b/user_password_strength/static/description/assets/icons/restaurant-black.png new file mode 100644 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/service-black.png b/user_password_strength/static/description/assets/icons/service-black.png new file mode 100644 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/trading-black.png b/user_password_strength/static/description/assets/icons/trading-black.png new file mode 100644 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 100644 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/update.png b/user_password_strength/static/description/assets/icons/update.png new file mode 100644 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 100644 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/wrench.png b/user_password_strength/static/description/assets/icons/wrench.png new file mode 100644 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/misc/star (1) 2.svg b/user_password_strength/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/user_password_strength/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_password_strength/static/description/assets/modules/pic1.png b/user_password_strength/static/description/assets/modules/pic1.png new file mode 100644 index 000000000..0e311ca87 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/pic1.png differ diff --git a/user_password_strength/static/description/assets/modules/pic2.png b/user_password_strength/static/description/assets/modules/pic2.png new file mode 100644 index 000000000..a0ac2d840 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/pic2.png differ diff --git a/user_password_strength/static/description/assets/modules/pic3.png b/user_password_strength/static/description/assets/modules/pic3.png new file mode 100644 index 000000000..cb17cf612 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/pic3.png differ diff --git a/user_password_strength/static/description/assets/modules/pic4.jpg b/user_password_strength/static/description/assets/modules/pic4.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/pic4.jpg differ diff --git a/user_password_strength/static/description/assets/modules/pic5.png b/user_password_strength/static/description/assets/modules/pic5.png new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/user_password_strength/static/description/assets/modules/pic5.png differ diff --git a/user_password_strength/static/description/assets/modules/pic6.jpg b/user_password_strength/static/description/assets/modules/pic6.jpg new file mode 100644 index 000000000..73781cf50 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/pic6.jpg differ diff --git a/user_password_strength/static/description/assets/screenshots/PSC03.png b/user_password_strength/static/description/assets/screenshots/PSC03.png new file mode 100644 index 000000000..e883aefd5 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/PSC03.png differ diff --git a/user_password_strength/static/description/assets/screenshots/PSC04.png b/user_password_strength/static/description/assets/screenshots/PSC04.png new file mode 100644 index 000000000..c0cb14d03 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/PSC04.png differ diff --git a/user_password_strength/static/description/assets/screenshots/final.png b/user_password_strength/static/description/assets/screenshots/final.png new file mode 100644 index 000000000..418111f48 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/final.png differ diff --git a/user_password_strength/static/description/assets/screenshots/hero.gif b/user_password_strength/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..a4a76ccd5 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/hero.gif differ diff --git a/user_password_strength/static/description/assets/screenshots/psc02.png b/user_password_strength/static/description/assets/screenshots/psc02.png new file mode 100644 index 000000000..62d801b20 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/psc02.png differ diff --git a/user_password_strength/static/description/assets/screenshots/psc1.png b/user_password_strength/static/description/assets/screenshots/psc1.png new file mode 100644 index 000000000..c9a2810ea Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/psc1.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..77123b019 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..ca231e68e 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..48a50ee8a --- /dev/null +++ b/user_password_strength/static/description/index.html @@ -0,0 +1,727 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ USER PASSWORD STRENGTH

+

+ User Password Strength - Configurable setting to 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

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

+ Choose Conditions

+
+
+
+ +
+ +
+

+ We can select the required conditions of a strong password.

+
+
+
+
+
+
+ +

+ Progressbar for password

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

+ Warnings on conditions

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

+ Password Length Restriction.

+
+
+
+ + +
+
+

+ If selected conditions of the password is not satisfies the user password an error message will appear as warning about the conditions in signup form and restricting further signup.

+
+
+
+
+
+ +

+ Strong Password

+
+
+
+ + +
+
+
+
+ +
+
+
    +
  • + Configurable Password Strength +
  • +
  • + Gives User Error Warnings +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:12th July 2024 +
+

+ Initial Commit for User Password Strength

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + 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..101394d30 --- /dev/null +++ b/user_password_strength/static/src/js/signup_user.js @@ -0,0 +1,135 @@ +/** @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 { jsonrpc } from "@web/core/network/rpc_service"; + import publicWidget from "@web/legacy/js/public/public_widget"; + var password = document.getElementById("password"); + publicWidget.registry.SignUpFormKeyupChange = publicWidget.Widget.extend({ + selector: '.oe_signup_form', + events: { + 'keypress input': '_onKeypress', + }, + init() { + this._super(...arguments); + }, + _onKeypress: function () { + jsonrpc('/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; + } + }); + // Reset if password length is zero + 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..4645fb7aa --- /dev/null +++ b/user_password_strength/views/restrict_password.xml @@ -0,0 +1,50 @@ + + + + res.config.settings.inherit.view + res.config.settings + + + +
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file 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..56e9eb310 --- /dev/null +++ b/user_password_strength/views/signup_page_view.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file