mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 06:42:14 +09:00
Split CAPTCHA check and loading methods for easy integration into other parts of the site
This commit is contained in:
parent
c0f9c77902
commit
4c9b14f077
2 changed files with 54 additions and 17 deletions
|
|
@ -225,23 +225,7 @@ class spamfilterController extends spamfilter
|
|||
function triggerCheckCaptcha(&$obj)
|
||||
{
|
||||
$config = ModuleModel::getModuleConfig('spamfilter');
|
||||
if (!isset($config) || !isset($config->captcha) || !in_array($config->captcha->type, ['recaptcha', 'turnstile']) || !$config->captcha->site_key || !$config->captcha->secret_key)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ($this->user->is_admin === 'Y')
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ($config->captcha->target_users !== 'everyone' && $this->user->member_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ($config->captcha->target_frequency !== 'every_time' && isset($_SESSION['recaptcha_authenticated']) && $_SESSION['recaptcha_authenticated'])
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!$config->captcha->target_devices[Mobile::isFromMobilePhone() ? 'mobile' : 'pc'])
|
||||
if (!SpamfilterModel::isCaptchaEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue