diff --git a/portal_recaptcha/README.rst b/portal_recaptcha/README.rst deleted file mode 100644 index 072066ec3..000000000 --- a/portal_recaptcha/README.rst +++ /dev/null @@ -1,67 +0,0 @@ -================ -Portal reCAPTCHA -================ - -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! This file is generated by oca-gen-addon-readme !! - !! changes will be overwritten. !! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png - :target: https://odoo-community.org/page/development-status - :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github - :target: https://github.com/coopiteasy/vertical-cooperative/tree/14.0/portal_recaptcha - :alt: coopiteasy/vertical-cooperative - -|badge1| |badge2| |badge3| - -This module is a cut-down version of the website_form_recaptcha OCA module. - -It allows you to integrate Google reCAPTCHA v2.0 to your -forms. You can configure your Google reCAPTCHA site and public keys -in "Settings" - -**Table of contents** - -.. contents:: - :local: - -Known issues / Roadmap -====================== - -Split website_form_recaptcha OCA module into portal_recaptcha (to be used in any form) and website_form_recaptcha (to use with website forms). - -Bug Tracker -=========== - -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. - -Do not contact contributors directly about support or help with technical issues. - -Credits -======= - -Authors -~~~~~~~ - -* Tech Receptives -* Coop IT Easy SC - -Contributors -~~~~~~~~~~~~ - -* Coop IT Easy SC - -Maintainers -~~~~~~~~~~~ - -This module is part of the `coopiteasy/vertical-cooperative `_ project on GitHub. - -You are welcome to contribute. diff --git a/portal_recaptcha/__init__.py b/portal_recaptcha/__init__.py deleted file mode 100644 index 04f1641e5..000000000 --- a/portal_recaptcha/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright 2004 Tech-Receptives Solutions Pvt. Ltd. -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from . import models diff --git a/portal_recaptcha/__manifest__.py b/portal_recaptcha/__manifest__.py deleted file mode 100644 index f0359c58d..000000000 --- a/portal_recaptcha/__manifest__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2004 Tech-Receptives Solutions Pvt. Ltd. -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -{ - "name": "Portal reCAPTCHA", - "version": "14.0.1.0.0", - "category": "Website", - "depends": ["portal"], - "author": "Tech Receptives, Coop IT Easy SC", - "license": "AGPL-3", - "website": "https://coopiteasy.be", - "summary": "Add google recaptcha to forms.", - "data": ["views/portal_mixin.xml", "views/res_config.xml"], - "installable": True, -} diff --git a/portal_recaptcha/i18n/portal_recaptcha.pot b/portal_recaptcha/i18n/portal_recaptcha.pot deleted file mode 100644 index b86755759..000000000 --- a/portal_recaptcha/i18n/portal_recaptcha.pot +++ /dev/null @@ -1,99 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * portal_recaptcha -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" -"Report-Msgid-Bugs-To: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: portal_recaptcha -#: model_terms:ir.ui.view,arch_db:portal_recaptcha.res_config_settings_view_form -msgid "" -"\n" -" How to get my reCaptcha Key" -msgstr "" - -#. module: portal_recaptcha -#: model:ir.model,name:portal_recaptcha.model_res_config_settings -msgid "Config Settings" -msgstr "" - -#. module: portal_recaptcha -#: model:ir.model.fields,field_description:portal_recaptcha.field_portal_mixin__display_name -#: model:ir.model.fields,field_description:portal_recaptcha.field_res_config_settings__display_name -msgid "Display Name" -msgstr "" - -#. module: portal_recaptcha -#: model:ir.model.fields,field_description:portal_recaptcha.field_portal_mixin__id -#: model:ir.model.fields,field_description:portal_recaptcha.field_res_config_settings__id -msgid "ID" -msgstr "" - -#. module: portal_recaptcha -#: model:ir.model.fields,field_description:portal_recaptcha.field_portal_mixin____last_update -#: model:ir.model.fields,field_description:portal_recaptcha.field_res_config_settings____last_update -msgid "Last Modified on" -msgstr "" - -#. module: portal_recaptcha -#: model:ir.model,name:portal_recaptcha.model_portal_mixin -msgid "Portal Mixin" -msgstr "" - -#. module: portal_recaptcha -#: model_terms:ir.ui.view,arch_db:portal_recaptcha.res_config_settings_view_form -msgid "Portal reCaptcha" -msgstr "" - -#. module: portal_recaptcha -#: model:ir.model.fields,field_description:portal_recaptcha.field_res_config_settings__recaptcha_key_secret -msgid "Recaptcha Key Secret" -msgstr "" - -#. module: portal_recaptcha -#: model:ir.model.fields,field_description:portal_recaptcha.field_res_config_settings__recaptcha_key_site -msgid "Recaptcha Key Site" -msgstr "" - -#. module: portal_recaptcha -#: code:addons/portal_recaptcha/models/portal_mixin.py:0 -#, python-format -msgid "The response parameter is invalid or malformed." -msgstr "" - -#. module: portal_recaptcha -#: code:addons/portal_recaptcha/models/portal_mixin.py:0 -#, python-format -msgid "The response parameter is missing." -msgstr "" - -#. module: portal_recaptcha -#: code:addons/portal_recaptcha/models/portal_mixin.py:0 -#, python-format -msgid "The secret parameter is invalid or malformed." -msgstr "" - -#. module: portal_recaptcha -#: code:addons/portal_recaptcha/models/portal_mixin.py:0 -#, python-format -msgid "The secret parameter is missing." -msgstr "" - -#. module: portal_recaptcha -#: code:addons/portal_recaptcha/models/portal_mixin.py:0 -#, python-format -msgid "There was a problem with the captcha entry." -msgstr "" - -#. module: portal_recaptcha -#: model_terms:ir.ui.view,arch_db:portal_recaptcha.res_config_settings_view_form -msgid "XXXXX" -msgstr "" diff --git a/portal_recaptcha/models/__init__.py b/portal_recaptcha/models/__init__.py deleted file mode 100644 index 827f227cf..000000000 --- a/portal_recaptcha/models/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2004 Tech-Receptives Solutions Pvt. Ltd. -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from . import res_config -from . import portal_mixin diff --git a/portal_recaptcha/models/portal_mixin.py b/portal_recaptcha/models/portal_mixin.py deleted file mode 100644 index c2d69dff2..000000000 --- a/portal_recaptcha/models/portal_mixin.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2019 Simone Orsi - Camptocamp SA -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -import requests - -from odoo import _, api, models -from odoo.exceptions import ValidationError - -URL = "https://www.google.com/recaptcha/api/siteverify" - - -class PortalMixin(models.AbstractModel): - _inherit = "portal.mixin" - - @api.model - def _get_error_message(self, errorcode=None): - mapping = { - "missing-input-secret": _("The secret parameter is missing."), - "invalid-input-secret": _("The secret parameter is invalid or malformed."), - "missing-input-response": _("The response parameter is missing."), - "invalid-input-response": _( - "The response parameter is invalid or malformed." - ), - } - return mapping.get(errorcode, _("There was a problem with the captcha entry.")) - - def is_captcha_valid(self, response): - recaptcha_key_secret = ( - self.env["ir.config_parameter"].sudo().get_param("recaptcha_key_secret") - ) - get_res = {"secret": recaptcha_key_secret, "response": response} - - res = requests.post(URL, data=get_res).json() - - error_msg = "\n".join( - self._get_error_message(error) for error in res.get("error-codes", []) - ) - if error_msg: - raise ValidationError(error_msg) - - if not res.get("success"): - raise ValidationError(self._get_error_message()) - return True diff --git a/portal_recaptcha/models/res_config.py b/portal_recaptcha/models/res_config.py deleted file mode 100644 index ffa84224d..000000000 --- a/portal_recaptcha/models/res_config.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2019 Simone Orsi - Camptocamp SA -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) - -from odoo import fields, models - - -class PortalConfigSettings(models.TransientModel): - _inherit = "res.config.settings" - - recaptcha_key_site = fields.Char( - config_parameter="portal_recaptcha.recaptcha_key_site" - ) - recaptcha_key_secret = fields.Char( - config_parameter="portal_recaptcha.recaptcha_key_secret" - ) diff --git a/portal_recaptcha/readme/CONTRIBUTORS.rst b/portal_recaptcha/readme/CONTRIBUTORS.rst deleted file mode 100644 index 8c568398a..000000000 --- a/portal_recaptcha/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1 +0,0 @@ -* Coop IT Easy SC diff --git a/portal_recaptcha/readme/DESCRIPTION.rst b/portal_recaptcha/readme/DESCRIPTION.rst deleted file mode 100644 index c55a77741..000000000 --- a/portal_recaptcha/readme/DESCRIPTION.rst +++ /dev/null @@ -1,5 +0,0 @@ -This module is a cut-down version of the website_form_recaptcha OCA module. - -It allows you to integrate Google reCAPTCHA v2.0 to your -forms. You can configure your Google reCAPTCHA site and public keys -in "Settings" diff --git a/portal_recaptcha/readme/ROADMAP.rst b/portal_recaptcha/readme/ROADMAP.rst deleted file mode 100644 index 06c686f24..000000000 --- a/portal_recaptcha/readme/ROADMAP.rst +++ /dev/null @@ -1 +0,0 @@ -Split website_form_recaptcha OCA module into portal_recaptcha (to be used in any form) and website_form_recaptcha (to use with website forms). diff --git a/portal_recaptcha/static/description/icon.png b/portal_recaptcha/static/description/icon.png deleted file mode 100644 index 592804560..000000000 Binary files a/portal_recaptcha/static/description/icon.png and /dev/null differ diff --git a/portal_recaptcha/static/description/recaptcha_setting.png b/portal_recaptcha/static/description/recaptcha_setting.png deleted file mode 100644 index 9c6a9224a..000000000 Binary files a/portal_recaptcha/static/description/recaptcha_setting.png and /dev/null differ diff --git a/portal_recaptcha/views/portal_mixin.xml b/portal_recaptcha/views/portal_mixin.xml deleted file mode 100644 index 9a016d213..000000000 --- a/portal_recaptcha/views/portal_mixin.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - -