| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* @since 6.0 |
| 8 |
*/ |
| 9 |
class FrmFieldCaptchaSettings { |
| 10 |
|
| 11 |
/** |
| 12 |
* @var string |
| 13 |
*/ |
| 14 |
public $secret; |
| 15 |
|
| 16 |
/** |
| 17 |
* @var string |
| 18 |
*/ |
| 19 |
public $token_field; |
| 20 |
|
| 21 |
/** |
| 22 |
* @var string |
| 23 |
*/ |
| 24 |
public $endpoint; |
| 25 |
|
| 26 |
public function __construct( $frm_settings ) { |
| 27 |
if ( $frm_settings->active_captcha === 'recaptcha' ) { |
| 28 |
$this->secret = $frm_settings->privkey; |
| 29 |
$this->token_field = 'g-recaptcha-response'; |
| 30 |
$this->endpoint = 'https://www.google.com/recaptcha/api/siteverify'; |
| 31 |
} else { |
| 32 |
$this->secret = $frm_settings->hcaptcha_privkey; |
| 33 |
$this->token_field = 'h-captcha-response'; |
| 34 |
$this->endpoint = 'https://hcaptcha.com/siteverify'; |
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
|