feat(captcha): Added Text Captcha provider (#1839)

* feat(captcha): Added `Text Captcha` provider

* Create TextCaptcha.php

* Updated

* Update composer.lock

* Updated

* Update config.php

* Update functions.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php

* Update TextCaptcha.php
This commit is contained in:
Roman Kelesidis 2025-03-09 00:12:48 +07:00 committed by GitHub
commit 74ea1573b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 165 additions and 31 deletions

View file

@ -2057,7 +2057,7 @@ function bb_captcha(string $mode): bool|string
$settings['language'] = $bb_cfg['default_lang'];
// Checking captcha settings
if (!$settings['disabled']) {
if (!$settings['disabled'] && $settings['service'] !== 'text') {
if (empty($settings['public_key']) || empty($settings['secret_key'])) {
bb_die($lang['CAPTCHA_SETTINGS']);
}
@ -2070,6 +2070,7 @@ function bb_captcha(string $mode): bool|string
'hCaptcha' => \TorrentPier\Captcha\HCaptcha::class,
'yandex' => \TorrentPier\Captcha\YandexSmartCaptcha::class,
'cloudflare' => \TorrentPier\Captcha\CloudflareTurnstileCaptcha::class,
'text' => \TorrentPier\Captcha\TextCaptcha::class
];
if (!isset($captchaClasses[$settings['service']])) {
bb_die(sprintf('Captcha service (%s) not supported', $settings['service']));