diff --git a/user_password_strength/README.rst b/user_password_strength/README.rst new file mode 100644 index 000000000..65665872d --- /dev/null +++ b/user_password_strength/README.rst @@ -0,0 +1,46 @@ +.. 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 `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developers: (V15) Ayana KP, 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/user_password_strength/__init__.py b/user_password_strength/__init__.py new file mode 100644 index 000000000..98249b758 --- /dev/null +++ b/user_password_strength/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayana K P (odoo@cybrosys.com) +# +# 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..2653fddd9 --- /dev/null +++ b/user_password_strength/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayana K P (odoo@cybrosys.com) +# +# 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': "15.0.1.0.0", + 'category': 'Website', + 'summary': """Validates User password strength in user signup form """, + 'description': """This module helps you to Validates the strength of + password in user signup form and restrict weak password. It will show the + strength of user password entered in signup form.""", + 'author': "Cybrosys Techno Solutions", + 'company': "Cybrosys Techno Solutions", + 'maintainer': "Cybrosys Techno Solutions", + 'website': "https://cybrosys.com/", + 'depends': ['base', 'website'], + 'data': [ + 'views/signup_page_templates.xml', + 'views/res_config_settings_views.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'user_password_strength/static/src/js/signup_user.js', + ], + }, + 'images': ['static/description/banner.png'], + '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..221d9c5fd --- /dev/null +++ b/user_password_strength/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayana K P (odoo@cybrosys.com) +# +# 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..c4228c7be --- /dev/null +++ b/user_password_strength/controllers/main.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayana K P (odoo@cybrosys.com) +# +# 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 . +# +############################################################################### +import re +from odoo import http, _ +from odoo.addons.web.controllers.main import Home +from odoo.exceptions import UserError +from odoo.http import request + + +class PasswordSecurity(Home): + """overriding the website signup controller""" + @http.route('/web/reset_password', type='http', auth='public', + website=True, sitemap=False) + 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.")) + supported_lang_codes = [code for code, _ in + request.env['res.lang'].get_installed()] + lang = request.context.get('lang', '') + if lang in supported_lang_codes: + values['lang'] = lang + return values + + @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..a8c838785 --- /dev/null +++ b/user_password_strength/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 30.06.2023 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for User Password Strength - Restrict Weak Password \ No newline at end of file diff --git a/user_password_strength/models/__init__.py b/user_password_strength/models/__init__.py new file mode 100644 index 000000000..cd1b65d18 --- /dev/null +++ b/user_password_strength/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayana K P (odoo@cybrosys.com) +# +# 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 res_config_settings diff --git a/user_password_strength/models/res_config_settings.py b/user_password_strength/models/res_config_settings.py new file mode 100644 index 000000000..5619e9785 --- /dev/null +++ b/user_password_strength/models/res_config_settings.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Ayana K P (odoo@cybrosys.com) +# +# 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 ResConfSettings(models.TransientModel): + """Inheriting configuration settings.""" + _inherit = "res.config.settings" + + user_password_restrict = fields.Boolean( + string="Restrict User Password", + default=True, + help="Field for Restrict User Password ") + is_strength = fields.Boolean( + string="Should have 8 characters", + config_parameter= + 'user_password_strength.is_strength', + help="Password Should have 8 characters") + is_digit = fields.Boolean( + string="Should have at least one number", + config_parameter='user_password_strength.is_digit', + help="Password Should have at least one number") + is_upper = fields.Boolean( + string="Should have at least one uppercase", + config_parameter='user_password_strength.is_upper', + help='Password Should have at least one uppercase') + is_lower = fields.Boolean( + string="Should have at least one lowercase character", + config_parameter='user_password_strength.is_lower', + help="Password have at least one lowercase character") + is_special_symbol = fields.Boolean( + string="Should have at least one special symbol", + config_parameter='user_password_strength.is_special_symbol', + help="Password Should have at least one 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/cybrosys-logo.png b/user_password_strength/static/description/assets/icons/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/user_password_strength/static/description/assets/icons/cybrosys-logo.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/modules/1.png b/user_password_strength/static/description/assets/modules/1.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/user_password_strength/static/description/assets/modules/1.png differ diff --git a/user_password_strength/static/description/assets/modules/2.png b/user_password_strength/static/description/assets/modules/2.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/user_password_strength/static/description/assets/modules/2.png differ diff --git a/user_password_strength/static/description/assets/modules/3.png b/user_password_strength/static/description/assets/modules/3.png new file mode 100644 index 000000000..3c3ff1afb Binary files /dev/null and b/user_password_strength/static/description/assets/modules/3.png 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..3fae4631e 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.gif b/user_password_strength/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/5.gif differ diff --git a/user_password_strength/static/description/assets/modules/6.png b/user_password_strength/static/description/assets/modules/6.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/6.png 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..4e0a6fe89 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..2bb08818d 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..3c724987d 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.png b/user_password_strength/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..ec5721255 Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/hero.png 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..2c39bc92c 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..2b53f840f Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/psc1.png differ diff --git a/user_password_strength/static/description/assets/screenshots/user_signup_1.png b/user_password_strength/static/description/assets/screenshots/user_signup_1.png new file mode 100644 index 000000000..a53ca4e6f Binary files /dev/null and b/user_password_strength/static/description/assets/screenshots/user_signup_1.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..708718142 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..752592811 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..59842e07e --- /dev/null +++ b/user_password_strength/static/description/index.html @@ -0,0 +1,627 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +
+
+
+

+ User Password Strength - Restrict Weak Password +

+

+ Validates Password Strength in User Signup Form +

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

+ Overview +

+
+
+

+ This module helps to show user password strength by checking if the password is a combination of + alphanumeric characters along with special characters and shows percentage of the strength of the + password and complexity of the password with the help of few conditions. + + Conditions for a strong password are: + + - Should have 8 characters. + - Should have at least one number. + - Should have at least one uppercase and one lowercase character. + - Should have at least one special symbol. +

+
+
+ + + +
+
+

+ Configuration +

+
+
+

+ No additional configuration required

+
+
+
+
+

+ Features +

+
+
+
+ +
+
+

+ Community, Enterprise & Odoo.sh Support

+

+ Available in Odoo 15.0 Community, Enterprise and Odoo.sh.

+
+
+
+
+ +
+
+

+ Password strength restriction in settings.

+

+ We can choose the conditions for a strong password from configuration settings.

+
+
+
+
+ +
+
+

+ User Error Warnings.

+

+ If conditions of the password are not follows while giving password a user error will appear.

+
+
+
+
+ +
+
+

+ Progressbar for password.

+

+ Progressbar for understanding the strength of the password.

+
+
+ + + +
+
+

+ Screenshots +

+
+
+

+ Choose Conditions

+

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

+ +
+
+

+ Select Customer Free signup for customer

+

+ Allow customer to Create account. +

+ +
+
+

+ Progressbar for password.

+ +
+
+

+ Warnings on conditions

+

+ 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. +

+ +
+
+

+ Password Length Restriction.

+ +
+
+

+ Strong Password.

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

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

+
+
+
+
+ + + +
+
+
+

Need Help?

+
+
+
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+
\ 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..46e740bde --- /dev/null +++ b/user_password_strength/static/src/js/signup_user.js @@ -0,0 +1,161 @@ +/** @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. + var PublicWidget = require('web.public.widget'); + var ajax = require("web.ajax"); + var password = document.getElementById("password"); + var MySignUpForm = PublicWidget.registry.SignUpForm.extend({ + selector: '.oe_signup_form', + events: { + 'keyup': '_onKeyup', + }, + _onKeyup: function () { + // Rendering ajax Rpc call from controller through route + ajax.jsonRpc('/web/config_params', 'call', { + }).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(current_pwd){ + 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 = "50"; + 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: + progress = "33.33"; + currentColor = colors[0]; + break; + case 2: + progress = "66.66"; + currentColor = colors[1]; + break; + case 3: + progress = "100"; + currentColor = colors[1]; + break; + case 4: + progress = "100"; + currentColor = colors[1]; + break; + case 5: + progress = "100"; + currentColor = colors[1]; + break; + } + } + //When 2 conditions are enabled in config settings + if (flag == 2) { + switch (prog) { + case 0: + case 1: + progress = "66.66"; + currentColor = colors[1]; + break; + case 2: + progress = "100"; + currentColor = colors[1]; + break; + + case 3: + progress = "100"; + currentColor = colors[1]; + break; + case 4: + progress = "100"; + currentColor = colors[1]; + break; + case 5: + progress = "100"; + currentColor = colors[1]; + break; + } + } + //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; + } + }, + }); + PublicWidget.registry.MySignUpForm = MySignUpForm; + return MySignUpForm; \ No newline at end of file diff --git a/user_password_strength/views/res_config_settings_views.xml b/user_password_strength/views/res_config_settings_views.xml new file mode 100644 index 000000000..2f3a8637b --- /dev/null +++ b/user_password_strength/views/res_config_settings_views.xml @@ -0,0 +1,54 @@ + + + + + + res.config.settings.inherit.view.user.password.strength + + res.config.settings + + + +
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/user_password_strength/views/signup_page_templates.xml b/user_password_strength/views/signup_page_templates.xml new file mode 100644 index 000000000..e4ef62892 --- /dev/null +++ b/user_password_strength/views/signup_page_templates.xml @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file