Multi captcha package for CodeIgniter 4.x

Overview

Farsi | English

CI Multi Captcha(CIMC)

This package can be used for Codigniter Framework version 4 and above. This package supports 4 captcha services, including Arcaptcha service (professional captcha service, including image guessing, puzzles, etc. made in Iran), Bibot (puzzle captcha service made in Iran), Recaptcha (made by Google) and hCaptcha. The user of this package can specify which captcha to use or specify that a captcha be selected at random.

Demo CIMC

Installation video tutorial

Here are tutorials on setting up, installing and how to use this package properly. For information on how to use this package correctly, please watch the uploaded videos. tutorials videos in Youtube

How to install on the Codigniter framework

First, download the latest version of the package. Then extract the downloaded zip file in the app/ThirdParty path. Now go to app/Config . Add the following to the Autoload.php file and save the file.

    public $psr4 = [
	//Add this line
        'CIMC' 	        => APPPATH . 'ThirdParty\CIMultiCaptcha',
    ];
    

In the next step, go to the app/Config path and add the following values in the Validation.php file.

    public $ruleSets = [
        // Add this line
        '\CIMC\Validation\RulesCIMC',
    ];
    public $templates = [
        // Add this line
        'CIMC_ERRORS_LIST'      => 'CIMC\Validation\Views\_list.php',
        // Add this line
        'CIMC_ERRORS_SINGLE'    => 'CIMC\Validation\Views\_single.php',
    ];
    

In the next step, go to the app/Config path and add the following values in the Filters.php file. Note:: This feature is supported from version V1.0.2pre-alpha onwards. With this feature you can enable RateLimit. Activity rate limit parameters can be edited through file app/ThirdParty/CIMultiCaptcha/Config/MultiCaptchaCIConfig.php. Rate limiting is often employed to stop bad bots from negatively impacting a website or application. Bot attacks that rate limiting can help mitigate include:Brute force attacks,DoS and DDoS attacks,Web scraping. More info about rate Limit.

    public $aliases = [
        //add for mix rate limit and captcha
        'rate_limit_by_captcha' => \CIMC\Filters\RateLimitByCaptcha::class,
    ];
    public $filters = [
        //add for mix rate limit and captcha in all url
        'rate_limit_by_captcha' => ['before' => ['/*']]
    ];
    

Demo Rate Limiting :: number_of_action : 5 ,captcha_name: hcaptcha Demo Rate Limiting

The default activity rate parameters in file MultiCaptchaCIConfig.php are as follows, you can decide to false or change at any time.

    public $rateLimit=[
        'rate_limit_on'                         =>   true,                              //(true | false)
        'number_of_action'                      =>   25,                                //number of tokens the bucket holds
        'refill_period'                         =>   HOUR,                              //amount of time it takes the bucket to refill (SECOND |MINUTE|HOUR|DAY|WEEK|MONTH|YEAR|DECADE)
        'captcha_name'                          =>   'recaptcha',                       //The name of the captcha used on the Rate Limit page. (arcaptcha|recaptcha|hcaptcha|bibot)
        'rate_limit_view'                       =>   'CIMC\Views\rate_limit',           //The view of used on the Rate Limit page.
    ];
    

Package configuration file

Before using this package, you need to receive two dedicated keys from each of the Captcha servers. In order to receive the keys, you must register in each of the Captcha servers and receive the keys. for receive Arcaptcha service keys to Arcaptcha registration address , for receive Bibot keys to Bibot registration address, for receive recaptcha keys to Recaptcha registration address and for receive hcaptcha keys to hCaptcha registration address . Get the keys to act. Then go to a app/ThirdParty/CIMultiCaptcha/Config and replace the relevant site_key and secret_key keys in the MultiCaptchaCIConfig.php file. If you need to change the color, theme, size and... proceed through this file. In the case of the captcha language, the package defaults to any language set in the CI framework and displays the captcha in the same language. If you need to customize the captcha language, set the lang values through this file. Important point in this regard, the two Iranian servers (Arcaptcha and Bibot) support only two languages Persian (fa) and English (en), this restriction is related to captcha servers and not the package.

How to use (CIMC)

In general, how to use this package will be in two ways. The first method is to select the service by the programmer, for example, the programmer intends to use only the recaptcha service, so he must follow the blue path according to the diagram below. The next item is the programmer has no role in specifying the service. The system randomly selects one of the services, to do this you have to follow the black path.

  flowchart LR;
      A[CI MULTI CHAPTCHA]-->B{Select captcha service by developer?};
      classDef c-Rc color:#022e1f,fill:#1a73e8;
      classDef c-Hc color:#022e1f,fill:#22c5c7;
      classDef c-Ac color:#022e1f,fill:#867ee2;
      classDef c-Bc color:#022e1f,fill:#ccc;
      classDef black color:#fff,fill:#000;
      B--YES-->C[How to use?]:::black;
      
      C-->U[I choose recaptcha.]:::c-Rc;
      U--Views-->Q["echo CIMC_JS('recaptcha');\n echo CIMC_ERROR(); \n echo CIMC_HTML(['captcha_name'=>'recaptcha']);"]:::c-Rc;
      U--Controller-->W["CIMC_FIELD('recaptcha) => CIMC_RULE(),"]:::c-Rc;

      C-->H[I choose hcaptcha.]:::c-Hc;
      H--Views-->J["echo CIMC_JS('hcaptcha');\n echo CIMC_ERROR(); \n echo CIMC_HTML(['captcha_name'=>'hcaptcha']);"]:::c-Hc;
      H--Controller-->G["CIMC_FIELD('hcaptcha) => CIMC_RULE(),"]:::c-Hc;
      
      C-->I[I choose arcaptcha.]:::c-Ac;
      I--Views-->O["echo CIMC_JS('arcaptcha');\n echo CIMC_ERROR(); \n echo CIMC_HTML(['captcha_name'=>'arcaptcha']);"]:::c-Ac;
      I--Controller-->P["CIMC_FIELD('arcaptcha) => CIMC_RULE(),"]:::c-Ac;
      
      C-->X[I choose bibot.]:::c-Bc;
      X--Views-->V["echo CIMC_JS('bibot');\n echo CIMC_ERROR(); \n echo CIMC_HTML(['captcha_name'=>'bibot']);"]:::c-Bc;
      X--Controller-->N["CIMC_FIELD('bibot) => CIMC_RULE(),"]:::c-Bc;
      
      B--NO-->D[How to use?]:::black;
      D---Views:::black-->F["echo CIMC_JS('randomcaptcha');\n echo CIMC_ERROR();\n echo CIMC_HTML(['captcha_name'=>'randomcaptcha']);"]:::black; 
      D---Controller:::black-->T["CIMC_FIELD('archaptcha,recaptcha,hcaptcha,bibot') => CIMC_RULE(),"]:::black; 

To improve

This package is provided as an open source. If you need to talk, come up with an idea, etc. via discussions Also, if there is a bug, please register via issues . If you are a programmer, please try to better participate in coding through pulls . We need each and every one of you to improve.

You might also like...
A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package

laravel-social A Laravel 5 package for OAuth Social Login/Register implementation using Laravel socialite and (optionally) AdminLTE Laravel package. I

A flexible, driver based Acl package for PHP 5.4+
A flexible, driver based Acl package for PHP 5.4+

Lock - Acl for PHP 5.4+ I'm sad to say that Lock is currently not maintained. I won't be able to offer support or accept new contributions for the cur

A One Time Password Authentication package, compatible with Google Authenticator.
A One Time Password Authentication package, compatible with Google Authenticator.

Google2FA Google Two-Factor Authentication for PHP Google2FA is a PHP implementation of the Google Two-Factor Authentication Module, supporting the HM

PHP package built for Laravel 5.* to easily handle a user email verification and validate the email

jrean/laravel-user-verification is a PHP package built for Laravel 5.* & 6.* & 7.* & 8.* to easily handle a user verification and validate the e-mail.

via this package you can push notifications to [ Facebook , Twitter , Telegram , Linkedin ]  ( Laravel )
via this package you can push notifications to [ Facebook , Twitter , Telegram , Linkedin ] ( Laravel )

Push To Social [ Facebook , Twitter , Telegram , Linkedin ] via this package you can push notifications to [ Facebook , Twitter , Telegram , Linkedin

Dynamic ACL is a package that handles Access Control Level on your Laravel Application.

Dynamic ACL Dynamic ACL is a package that handles Access Control Level on your Laravel Application. It's fast to running and simple to use. Install an

Powerful package for handling roles and permissions in Laravel 5

Roles And Permissions For Laravel 5 Powerful package for handling roles and permissions in Laravel 5 (5.1 and also 5.0). Installation Composer Service

Laravel package to easily login as other users during development.
Laravel package to easily login as other users during development.

A Laravel 5.4 utility package to enable developers to log in as other users during development. Installation To install the package, simply follow the

Releases(v1.0.2-pre-alpha)
  • v1.0.2-pre-alpha(Feb 28, 2022)

    Rate limiting is often employed to stop bad bots from negatively impacting a website or application. Bot attacks that rate limiting can help mitigate include: Brute force attacks DoS and DDoS attacks Web scraping Rate limiting also protects against API overuse, which is not necessarily malicious or due to bot activity, but is important to prevent nonetheless.

    Full Changelog: https://github.com/datamweb/CodeIgniter-Multi-Captcha/compare/v1.0.1-pre-alpha...v1.0.2-pre-alpha

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1-pre-alpha(Feb 23, 2022)

  • v1.0.0-pre-alpha(Feb 22, 2022)

Owner
Pooya Parsa Dadashi
If you don't walk your true path, you won't find your true people.
Pooya Parsa Dadashi
Sliding captcha for dcat-admin auth / dcat-admin登陆 滑动验证插件 多平台支持

dcat-admin登陆 滑动验证插件 多平台支持 dcat-admin登陆 滑动验证插件 多平台支持 另有 laravel-admin版 Demo演示 演示站点(暂时无,目前地址为laravel-admin版的演示地址) 支持(按照字母顺序) 顶象 ✔️ 极验 ✔️ hCaptcha(和谷歌Rec

塵世不再 38 Dec 17, 2022
Automatically fill in the captcha code in the NTHU OAuth login page.

NTHU-OAuth-Decaptcha Automatically fill in the captcha code in the NTHU OAuth login page. CNN Decaptcha For training the decaptcha model. See CNN Deca

null 18 Dec 4, 2022
Authentication and authorization library for Codeigniter 4

Authentication and Authorization Library for CodeIgniter 4. This library provides an easy and simple way to create login, logout, and user registratio

Rizky Kurniawan 12 Oct 10, 2022
Mock authentication for CodeIgniter 4

Tatter\Imposter Mock authentication for CodeIgniter

Tatter Software 3 Feb 16, 2022
A user, group, role and permission management for Codeigniter 4

CI4-Auth CI4-Auth is a user, group, role and permission management library for Codeigniter 4. CI4-Auth is based on the great Myth-Auth library for Cod

George Lewe 15 Dec 16, 2022
Painless OAuth 2.0 Server for CodeIgniter 4 🔥

Inspired from the Norse mythology, Heimdallr, modernly anglicized as Heimdall is the gatekeeper of Bifröst, the rainbow road connecting Midgard, realm

Ezra Lazuardy 37 Nov 12, 2022
Multi-provider authentication framework for PHP

Opauth is a multi-provider authentication framework for PHP, inspired by OmniAuth for Ruby. Opauth enables PHP applications to do user authentication

Opauth – PHP Auth Framework 1.7k Jan 1, 2023
Multi Auth and admin auth in Laravel Project

Laravel Multi Auth For Complete Documentation, visit Here This package is just create admin side (multi auth), which is totaly isolated from your norm

Bitfumes 435 Dec 31, 2022
Multi-factor Authentication using a Public PGP key for web based applications

PGPmfa() a PHP Class for PGP Multi-factor Authentication using a Public PGP key for web based applications Multi-factor Authentication with PGP Second

null 2 Nov 27, 2022
LINE strategy for Opauth, Opauth is a multi-provider authentication framework for PHP.

Opauth-LINE Opauth strategy for LINE. Implemented based on https://developers.line.me/web-api/integrating-web-login-v2 using OAuth 2.0. Opauth is a mu

Opauth – PHP Auth Framework 2 Jul 11, 2017