PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Security / HCaptcha / HCaptchaConfigProvider.php

HCaptchaConfigProvider.php in The Innovative Form Builder – IvyForms 1.5, at backend/src/Services/Security/HCaptcha/HCaptchaConfigProvider.php

47 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @copyright © Melograno Venture Studio. All rights reserved.
5 * @licence See COPYING.md for license details.
6 */
7
8 namespace IvyForms\Services\Security\HCaptcha;
9
10 use IvyForms\Services\Security\Common\CaptchaServiceInterface;
11
12 /**
13 * Provides hCaptcha frontend configuration
14 *
15 * @package IvyForms\Services\Security\HCaptcha
16 */
17 class HCaptchaConfigProvider
18 {
19 /**
20 * Get hCaptcha configuration for frontend
21 *
22 * @param CaptchaServiceInterface|null $service
23 * @return array<string, mixed>
24 */
25 public function getConfig(?CaptchaServiceInterface $service): array
26 {
27 $config = [
28 'configured' => false,
29 'type' => 'checkbox',
30 'siteKey' => '',
31 'scriptUrl' => '',
32 'size' => 'normal'
33 ];
34
35 if ($service && $service->isConfigured()) {
36 $hcaptchaConfig = $service->getFrontendConfig(
37 $service->getType(),
38 $service->getSiteKey()
39 );
40 $hcaptchaConfig['configured'] = true;
41 return $hcaptchaConfig;
42 }
43
44 return $config;
45 }
46 }
47