定制 blueways/bw-captcha 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

blueways/bw-captcha

Composer 安装命令:

composer require blueways/bw-captcha

包简介

Captcha element with audio support for TYPO3 form components. The captcha generation does not rely on Google or third-party integrations.

关键字:

README 文档

README

Extension icon

TYPO3 extension bw_captcha

Latest version Supported TYPO3 versions Total downloads TYPO3 extension Composer

This extension adds a captcha element for the TYPO3 form component. The captcha generation uses Gregwar/Captcha, no Google or 3rd party includes.

Frontend Captcha example

Install

Composer

composer require blueways/bw-captcha

TER

TER version

Download the zip file from TYPO3 extension repository (TER).

Usage

Add the captcha element via Form Editor to your form or directly to your yaml form.

Via Form Editor

Captcha via Form Editor

Or manual configuration

renderables:
    -   type: Captcha
        identifier: captcha
        label: Captcha
        properties:
        fluidAdditionalAttributes:
            required: required
            autocomplete: 'off'

Configuration

Via Site Set (recommended)

Include the site set blueways/bw-captcha in your site configuration.

To modify the captcha output, use the site settings module and adjust the settings in the "Accessible Form Captcha" section.

Via TypoScript

Alternatively, include the static TypoScript template or include setup and constants manually.

To modify the captcha output, you can use the following TypoScript constants:

plugin.tx_bwcaptcha {
    settings {
        # Show reload button
        refreshButton =

        # Show audio button for speech output
        audioButton =

        # The length of the captcha
        length =

        # The charset of the captcha
        charset =

        # The width of the image
        width =

        # The height of the image
        height =

        # Custom font file(s) to use (comma-separated)
        fontFiles =

        # Text color (e.g. 255,0,0)
        textColor =

        # Line color (e.g. 0,0,0)
        lineColor =

        # Background color (e.g. 255,255,255)
        backgroundColor =

        # Distortion
        distortion =

        # The maximum number of lines to draw in front of
        maxFrontLines =

        # The maximum number of lines to draw behind
        maxBehindLines =

        # The maximum angle of char
        maxAngle =

        # The maximum offset of char
        maxOffset =

        # Is the interpolation enabled?
        interpolation =

        # Ignore all effects
        ignoreAllEffects =
    }
}

Usage in other Extensions

sf_event_mgt

To use the captcha element in the sf_event_mgt extension, you need to include the captcha partial in your custom event Registration template and activate the sfEventMgt feature in the extension settings:

<f:form>
    ...
+  <f:render partial="Registration/Captcha/BwCaptcha.html" arguments="{_all}" />
</f:form>
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['bw_captcha']['sfEventMgt'] = 1;

Overriding the captcha element

To override the captcha partial, copy it to your extension and add the partial path to your form setup:

TYPO3:
    CMS:
        Form:
        prototypes:
            standard:
            formElementsDefinition:
                Form:
                renderingOptions:
                    partialRootPaths:
                    1680889288: 'EXT:your_ext/Resources/Private/Frontend/Partials/'

Migration from version 4.x to 5.x

In this version the inline JavaScript has been moved to a separate file to better comply with a Content Security Policy (CSP). If you dynamically load or display the captcha element, you probably need to initialize the captcha manually:

window.BwCaptcha.init();

Make sure the JavaScript file is included in your page: EXT:bw_captcha/Resources/Public/JavaScript/Frontend/Captcha.js

Migration from version 3.x to 4.x

This version aims to make solving the captcha more accessible. It introduces a new audio feature that reads out the current captcha code. Missing ARIA properties have been added.

  • Check out the new captcha partial
  • Audio button is enabled by default (can be disabled via plugin.tx_bwcaptcha.settings.audioButton)

Migration from version 2.x to 3.x

The generation of the captcha moved to a middleware, which solves a lot of caching issues. Therefore, adjustments to the form element partial have been made. If you've modified the partial, you need to update the image tag and refresh button link.

tl;dr:

  • Check out the new captcha partial
  • Reload button is enabled by default (can be disabled via plugin.tx_bwcaptcha.settings.refreshButton)
  • You can re-enable the page cache, if disabled it because of this element

Troubleshooting

Refresh button not working

If your site is configured to use trailing slashes, the refresh url cannot be resolved. A simple fix is to add a setting for the pageType 3413, e.g.:

routeEnhancers:
    PageTypeSuffix:
        type: PageType
        default: /
        index: index
        map:
            /: 0
            .captcha: 3413
            .audio: 3414

License

This project is licensed under GNU General Public License 2.0 (or later).

Contribute

This extension was made by Maik Schneider: Feel free to contribute!

Thanks to blueways and XIMA!

blueways/bw-captcha 适用场景与选型建议

blueways/bw-captcha 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 313.18k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2021 年 06 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「typo3」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 blueways/bw-captcha 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 blueways/bw-captcha 我们能提供哪些服务?
定制开发 / 二次开发

基于 blueways/bw-captcha 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 313.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 16
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 4
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2021-06-09