almaviacx/captchetatbundle 问题修复 & 功能扩展

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

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

almaviacx/captchetatbundle

最新稳定版本:v2.1.0

Composer 安装命令:

composer require almaviacx/captchetatbundle

包简介

Add CaptchEtat to forms

README 文档

README

This repository is what we call a "subtree split": a read-only copy of one directory of the main repository. It is used by Composer to allow developers to depend on specific bundles.

If you want to report or contribute, you should instead open your issue on the main repository: https://github.com/Novactive/Nova-eZPlatform-Bundles

Documentation is available in this repository via .md files but also packaged here: https://novactive.github.io/Nova-eZPlatform-Bundles/master/2FABundle/README.md.html

This bundle provide a form type to use CaptchEtat (https://api.gouv.fr/les-api/api-captchetat) on your website

Installation

Requirements

  • Ibexa 4
  • PHP 7.4 || 8.0

Use Composer

Add the lib to your composer.json, run composer require almaviacx/captchetatbundle to refresh dependencies.

Register the bundle

Then inject the bundle in the config\bundles.php of your application.

    return [
        // ...
        AlmaviaCX\Bundle\CaptchEtatBundle\AlmaviaCXCaptchEtatBundle::class => [ 'all'=> true ],
    ];

Add routes

Make sure you add this route to your routing:

# config/routes.yaml

captchetat_routes:
    resource: '@AlmaviaCXCaptchEtatBundle/Resources/config/routes.yaml'

Accessibility

For accessibility, you might want to add the following script to your JS

import CaptchaEtat from '../public/bundles/almaviacxcaptchetat/js/captchetat-widget'
CaptchaEtat.init()

Configuration

Configuration can be done throught the following environment variables

CAPTCHETAT_API_URL="https://sandbox-api.piste.gouv.fr"
CAPTCHETAT_OAUTH_URL="https://sandbox-oauth.piste.gouv.fr"
CAPTCHETAT_OAUTH_CLIENT_ID=~
CAPTCHETAT_OAUTH_CLIENT_SECRET=~
CAPTCHETAT_TIMEOUT="2.5"

Depending on if you use "sandbox" (default) or "production" environment, you might want to change the urls to :

CAPTCHETAT_API_URL="https://api.piste.gouv.fr"
CAPTCHETAT_OAUTH_URL="https://oauth.piste.gouv.fr"

Add captcha to your form

$builder->add(
    'captcha', CaptchEtatType::class, 
    [
        'label' => 'customform.show.captcha',
    ]
);

Formbuilder forms

You can autommaticaly add the captcha to formbuilder forms by activating the following service decorator :

AlmaviaCX\Bundle\CaptchEtat\FormBuilder\FieldType\Field\Mapper\ButtonFieldMapperDecorator:
    decorates: Ibexa\FormBuilder\FieldType\Field\Mapper\ButtonFieldMapper
    arguments:
        $buttonFieldMapper: '@.inner'

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固