Support methods to load and check CAPTCHA wherever a developer wants

This commit is contained in:
Kijin Sung 2025-12-17 17:37:03 +09:00
parent 01984210b6
commit 307661b57b
10 changed files with 127 additions and 11 deletions

View file

@ -115,6 +115,23 @@ class SpamfilterAdminController extends Spamfilter
$this->setRedirectUrl($returnUrl);
}
public function procSpamfilterAdminSubmitCaptchaTest()
{
$response = Context::get('g-recaptcha-response') ?? Context::get('cf-turnstile-response');
try
{
SpamfilterModel::checkCaptchaResponse($response);
}
catch (Exception $e)
{
return new BaseObject(-1, $e->getMessage());
}
$this->setMessage('msg_recaptcha_test_success');
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminConfigCaptchaTest'));
}
public function procSpamfilterAdminInsertDeniedIP()
{
//스팸IP 추가