Metadata-Version: 2.4
Name: collective.contactformprotection
Version: 2.0.0
Summary: This package protects the default contact form of Plone which is generally accessible via /contact-form. It provides a checkbox in the controlpanel to disable it globally and adds a (H/Re)captcha field depending on your installation.
Home-page: https://github.com/collective/collective.contactformprotection
Author: Peter Mathis
Author-email: peter.mathis@kombinat.at
License: GPL version 3
Project-URL: PyPI, https://pypi.org/project/collective.contactformprotection/
Project-URL: Source, https://github.com/collective/collective.contactformprotection
Project-URL: Tracker, https://github.com/collective/collective.contactformprotection/issues
Keywords: Python Plone CMS
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: Addon
Classifier: Framework :: Plone :: 6.0
Classifier: Framework :: Plone :: 6.1
Classifier: Framework :: Plone :: 6.2
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Requires-Python: >=3.10
License-File: LICENSE.GPL
License-File: LICENSE.rst
Requires-Dist: Products.CMFPlone
Requires-Dist: plone.api>=1.8.4
Requires-Dist: plone.app.dexterity
Requires-Dist: plone.app.registry
Requires-Dist: z3c.form
Provides-Extra: recaptcha
Requires-Dist: plone.formwidget.recaptcha; extra == "recaptcha"
Provides-Extra: hcaptcha
Requires-Dist: plone.formwidget.hcaptcha; extra == "hcaptcha"
Provides-Extra: norobots
Requires-Dist: collective.z3cform.norobots; extra == "norobots"
Provides-Extra: test
Requires-Dist: plone.app.testing; extra == "test"
Requires-Dist: plone.testing>=5.0.0; extra == "test"
Requires-Dist: plone.app.contenttypes; extra == "test"
Requires-Dist: plone.app.robotframework[debug]; extra == "test"
Requires-Dist: plone.formwidget.recaptcha; extra == "test"
Requires-Dist: plone.formwidget.hcaptcha; extra == "test"
Requires-Dist: collective.z3cform.norobots; extra == "test"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

.. This README is meant for consumption by humans and PyPI. PyPI can render rst files so please do not use Sphinx features.
   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
   This text does not appear on PyPI or github. It is a comment.

.. image:: https://github.com/collective/collective.contactformprotection/actions/workflows/meta.yml/badge.svg
    :target: https://github.com/collective/collective.contactformprotection/actions/workflows/meta.yml


================================
collective.contactformprotection
================================

This package protects the default contact form of Plone which is generally accessible via ``/contact-info``.
If you have installed this product, you can go to the ``Contacformprotection Control Panel`` and adjust its settings.


Settings
--------

- Provide a checkbox in the controlpanel to disable the form globally
- Add a H/Recaptcha/Norobots field depending on the installed 3rd party addon ``plone.formwidget.[h|re]captcha`` or ``collective.z3cform.norobots``.


Captcha support
---------------

If you have installed ``plone.formwidget.recaptcha``, ``plone.formwidget.hcaptcha`` or ``collective.z3cform.norobots`` it is automatically
added to the form. In case both are installed, you can make a choice in the controlpanel.

You can install the packages by adding the ``extra_required`` to this package::

    [buildout]
    ...
    eggs =
        collective.contactformprotection[hcaptcha,recaptcha,norobots]


The settings mentioned above are all set in the configuration registry. See ``plone.app.registry`` how to set these
values TTW or in a package profile.


Installation
------------

Install collective.contactformprotection by adding it to your buildout::

    [buildout]

    ...

    eggs =
        collective.contactformprotection


and then running ``bin/buildout``


Customizing Captcha vocabulary
------------------------------

The captcha settings is provided by a zope vocabulary with enhanced term objects::

    class CaptchaVocabItem(object):
        def __init__(self, token, value, widget=None, validator_view=""):
            self.token = token
            self.value = value
            self.widget = widget
            self.validator_view = validator_view

If you have additional captcha addons or want to override the provided widget and validator view, you can
override the vocabulary utility ``contactformprotection.captchavocabulary`` with your terms.



Authors
-------

Peter Mathis, petschki



Contribute
----------

- Issue Tracker: https://github.com/collective/collective.contactformprotection/issues
- Source Code/Documentation: https://github.com/collective/collective.contactformprotection


License
-------

The project is licensed under the GPLv3.


Contributors
============

- Peter Mathis, peter.mathis@kombinat.at


2.0.0 (2026-05-19)
------------------

Breaking changes:


- Replace ``pkg_resources`` namespace with PEP 420 native namespace. (#3928)


New features:


- Add support for Plone 6.1, 6.2, and related Pythons.
  Drop support for Python 3.8 and 3.9.
  [maurits]


Changelog
=========


1.1.0 (2025-05-26)
------------------

- Implement collective.z3cform.norobots support. @petschki


1.0.0 (2024-04-29)
------------------

- Initial release.
  [petschki]
