friendsoforo/oro-recaptcha-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

friendsoforo/oro-recaptcha-bundle

Composer 安装命令:

composer create-project friendsoforo/oro-recaptcha-bundle

包简介

Oro Bundle to inject ReCAPTCHA into public forms

README 文档

README

This bundle adds Google ReCAPTCHA protection for various Oro features.

Features which can currently be protected are:

  • Registration Form
  • Contact Us Form

Extends the Symfony EWZRecaptchaBundle by excelwebzone

Requirements

This bundle supports the following Oro Platform versions:

  • Oro Platform v3.x

    • Support for this version is on the "v3.x" branch
  • Oro Platform v4.1.x

    • Support for this version is on the "v4.1.x" branch
  • Oro Platform v4.2.x

    • Support for this version is on the "v4.2.x" branch
  • Oro Platform v5.x

    • Support for this version is on the "v5.x" branch
  • Oro Platform v6.0.x

    • Support for this version is on the "v6.0.x" branch

The Master branch will always track support for the latest released Oro Platform version.

Installation and Usage

NOTE: Adjust instructions as needed for your local environment

  1. Install via Composer:
    composer require friendsoforo/oro-recaptcha-bundle
  2. Update your config.yml:
    # app/config/config.yml
    
    ewz_recaptcha:
        public_key:  here_is_your_public_key
        private_key: here_is_your_private_key
    
        # Not needed as "%kernel.default_locale%" is the default value for the locale key
        # locale_key:  %kernel.default_locale%
    
        # etc. Refer to the ewz_recaptcha package for more information.
  3. Purge Oro cache:
    php bin/console cache:clear --env=prod
  4. Login to Oro Admin
  5. Navigate to System Configuration => Integrations => ReCAPTCHA
  6. Configure the ReCAPTCHA widget and enabled/disable Protected Features
  7. Save the configuration and verify that it is now appearing on the frontend website

Testing in Development

Copy the config.yml values into config_dev.yml and replace the public/private keys with the test keys provided by Google: https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha-what-should-i-do

The widget should render on the forms, but will be overlaid with the text:

"This reCAPTCHA is for testing purposes only. Please report to the site admin if you are seeing this. "

Adding to new Form Types

  1. Create a new Form Type Extension which extends HackOro\RecaptchaBundle\Form\Extension\AbstractRecaptchaTypeExtension
    <?php
    namespace Acme\CustomBundle\Form\Extension;
    
    use Acme\CustomBundle\Form\Type\CustomPageType;
    
    class CustomPageTypeExtension extends AbstractRecaptchaTypeExtension
    {
        public function getExtendedType()
        {
            // The Form Type we are extending
            return CustomPageType::class;
        }
    
        /**
         * Protect the Custom Page Form?
         * @return boolean
         */
        public function isProtected()
        {
            // Replace this with a configuration option if needed
            return true;
        }
    }
  2. Register the Form Type Extension via services.yml:
    hack_oro_recaptcha.form.registration_form_type_extension:
        class: Acme\CustomBundle\Form\Extension\CustomPageTypeExtension
        calls:
            - [setConfigManager, ['@oro_config.user']]
        tags:
            - { name: form.type_extension, extended_type: Acme\CustomBundle\Form\Type\CustomPageType }

Roadmap / Remaining Tasks

  • Add support for "Invisible" ReCAPTCHA v2
  • Add support for ReCAPTCHA v3
  • Add ability to customize ReCAPTCHA v3 score threshold on a per-feature basis
  • Add ability to set public/private keys via Oro Configuration instead of YAML files

Licence

MIT - MIT License

friendsoforo/oro-recaptcha-bundle 适用场景与选型建议

friendsoforo/oro-recaptcha-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23.38k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2019 年 06 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 friendsoforo/oro-recaptcha-bundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 23.38k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 9
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-18