diff --git a/user_password_strength/README.rst b/user_password_strength/README.rst new file mode 100644 index 000000000..743214a6d --- /dev/null +++ b/user_password_strength/README.rst @@ -0,0 +1,43 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://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: Jumana@cybrosys, + version 16: Jumana@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..66f658a12 --- /dev/null +++ b/user_password_strength/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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..142c2c9e5 --- /dev/null +++ b/user_password_strength/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Jumana J() +# +# 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': "16.0.1.0.0", + 'summary': """ User password strength - restrict weak password""", + 'description': """ User password strength - restrict weak password""", + '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..0a86e1ffc --- /dev/null +++ b/user_password_strength/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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..69c156081 --- /dev/null +++ b/user_password_strength/controllers/main.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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""" + + @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..63f9d51c8 --- /dev/null +++ b/user_password_strength/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.02.2023 +#### Version 16.0.1.0.0 +#### ADD +Initial Commit \ 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..4d463c66a --- /dev/null +++ b/user_password_strength/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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 diff --git a/user_password_strength/models/restrict_password.py b/user_password_strength/models/restrict_password.py new file mode 100644 index 000000000..b13440dbc --- /dev/null +++ b/user_password_strength/models/restrict_password.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# 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", + default=True) + is_strength = fields.Boolean(string="Should have 8 characters", + config_parameter= + 'user_password_strength.is_strength') + is_digit = fields.Boolean(string="Should have at least one number", + config_parameter='user_password_strength.i' + 's_digit') + is_upper = fields.Boolean(string="Should have at least one uppercase", + config_parameter='user_password_strength.' + 'is_upper') + is_lower = fields.Boolean(string="Should have at least one " + "lowercase character", + config_parameter='user_password_strength.' + 'is_lower') + is_special_symbol = fields.Boolean(string="Should have at least one " + "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/modules/module01.png b/user_password_strength/static/description/assets/modules/module01.png new file mode 100644 index 000000000..a9936f593 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/module01.png differ diff --git a/user_password_strength/static/description/assets/modules/module02.png b/user_password_strength/static/description/assets/modules/module02.png new file mode 100644 index 000000000..1a9e2cbd7 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/module02.png differ diff --git a/user_password_strength/static/description/assets/modules/module03.png b/user_password_strength/static/description/assets/modules/module03.png new file mode 100644 index 000000000..d3d28e08b Binary files /dev/null and b/user_password_strength/static/description/assets/modules/module03.png differ diff --git a/user_password_strength/static/description/assets/modules/module04.png b/user_password_strength/static/description/assets/modules/module04.png new file mode 100644 index 000000000..5297b364a Binary files /dev/null and b/user_password_strength/static/description/assets/modules/module04.png differ diff --git a/user_password_strength/static/description/assets/modules/module05.png b/user_password_strength/static/description/assets/modules/module05.png new file mode 100644 index 000000000..2263f673e Binary files /dev/null and b/user_password_strength/static/description/assets/modules/module05.png differ diff --git a/user_password_strength/static/description/assets/modules/module06.png b/user_password_strength/static/description/assets/modules/module06.png new file mode 100644 index 000000000..0b8c68699 Binary files /dev/null and b/user_password_strength/static/description/assets/modules/module06.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..1dc25724d 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..dda8b710e 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..a29d62443 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..a4a76ccd5 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..3975868c4 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..029267f8f 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..d8df9bd1b --- /dev/null +++ b/user_password_strength/static/description/index.html @@ -0,0 +1,679 @@ +
+ + +
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ + + +
+
+
+

+ User Password Strength - Restrict Weak Password +

+

+ User Password Strength - Restrict Weak Password +

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

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

+

+ Available in Odoo 16.0 Community and Enterprise .

+
+
+ +
+
+ +
+
+

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

+
+
+ +
+
+ +
+
+

+ Progressbar for password.

+

+ Progressbar for understanding the strength of the password.

+
+
+ + + + +
+
+

+ Screenshots +

+
+
+

+ Choose Conditions

+

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

+ +
+
+

+ Progressbar for password.

+ +
+ +
+

+ Warnings on conditions

+

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

+ +
+ +
+

+ Password Length Restriction.

+ +
+ + +
+

+ Strong Password.

+ +
+ +
+ + + +
+
+

Suggested Products

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

Our Services

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

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

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..07a2d81c9 --- /dev/null +++ b/user_password_strength/static/src/js/signup_user.js @@ -0,0 +1,140 @@ +odoo.define('user_password_strength.signup_user', function (require) { +"use strict"; + // 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 (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: + 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; + } + }, + }); + + PublicWidget.registry.MySignUpForm = MySignUpForm; + return MySignUpForm; +}); diff --git a/user_password_strength/views/restrict_password.xml b/user_password_strength/views/restrict_password.xml new file mode 100644 index 000000000..df68c89b6 --- /dev/null +++ b/user_password_strength/views/restrict_password.xml @@ -0,0 +1,52 @@ + + + + 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