feat: captcha protection for ep-events

This commit is contained in:
Björn Fromme
2024-08-19 11:11:09 +02:00
parent e6c4948644
commit e2bc3f72da
14 changed files with 200 additions and 64 deletions
@@ -136,8 +136,7 @@ class AjaxFormController extends ActionController implements LoggerAwareInterfac
];
if ($this->arguments->validate()->hasErrors()) {
foreach ($this->arguments->validate()->getFlattenedErrors() as $key => $errors)
{
foreach ($this->arguments->validate()->getFlattenedErrors() as $key => $errors) {
$key = str_replace('.', '', $key);
$errorsRaw = [];
foreach ($errors as $error)
@@ -33,6 +33,13 @@ class Inquiry extends AbstractValueObject
{
public const TOKEN_KEY = 'inquiry_form';
/**
* @var string
*
* @TYPO3\CMS\Extbase\Annotation\Validate("SJBR\SrFreecap\Validation\Validator\CaptchaValidator")
*/
protected $captchaResponse;
/**
* @var string
*/
@@ -226,6 +233,22 @@ class Inquiry extends AbstractValueObject
$this->token = $token;
}
/**
* @return string
*/
public function getCaptchaResponse()
{
return $this->captchaResponse;
}
/**
* @param string $captchaResponse
*/
public function setCaptchaResponse(string $captchaResponse)
{
$this->captchaResponse = $captchaResponse;
}
/**
* @return string
*/