nextbox/neos-formcaptcha

Neos 插件,为 Neos 表单构建器添加验证码功能

0.3.0 2023-02-22 13:22 UTC

This package is auto-updated.

Last update: 2024-09-07 03:08:19 UTC


README

此软件包添加了一个验证码元素,可以在您的表单中使用。此元素通过图像和输入字段呈现,并需要填写图像上显示的随机生成的短语。

如果验证码填写不正确,表单将不会提交,并且将生成新的图像。

安装

NextBox.Neos.FormCaptcha 软件包在 packagist 上列出。

只需在您的发行版中运行以下命令

composer require nextbox/neos-formcaptcha

Neos.Form.Builder 一起使用

将验证码表单元素添加到您的表单中。

NodeType in Neos-Form-Builder

Neos.Form 一起使用

将新表单元素添加到表单定义的可渲染项中

type: 'Neos.Form:Form'
identifier: 'someIdentifier'
renderables:
  -
    type: 'Neos.Form:Page'
    identifier: page-one
    renderables:
      -
        type: 'NextBox.Neos.FormCaptcha:Captcha'
        identifier: 'captcha'
finishers:
  -
    <Your finishers here>

Neos.Form 和 Neos.Form.Builder 的全局设置

您可以通过调整 Settings.yaml 中的设置来自定义验证码元素的显示。

NextBox:
  Neos:
    FormCaptcha:
      # allowed characters for the captcha elements
      possibleLetters: 'bcdfghjkmnpqrstvwxyz23456789'
      image:
        # captcha image width
        width: 130
        # captcha image height
        height: 50
      # number of characters displayed in the captcha image
      totalCharacters: 6
      random:
        # number of points displayed in the captcha image
        dots: 50
        # number of lines displayed in captcha image
        lines: 25
      # font color of the text
      textColor:
        r: 20
        g: 40
        b: 100
      # color of noise
      noiseColor:
        r: 20
        g: 40
        b: 100
      # background color of the Captcha image
      backgroundColor:
        r: 255
        g: 255
        b: 255

i18n

目前支持以下语言:英语、德语、丹麦语、西班牙语、芬兰语、法语、拉脱维亚语、荷兰语和挪威博克马尔语。

请随时将其他语言的标签发送给我们,以便我们可以将其添加到插件中。