mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Enable customizing target users and frequency
This commit is contained in:
parent
d13bf13bc9
commit
a2e54ed759
2 changed files with 15 additions and 5 deletions
|
|
@ -6,8 +6,21 @@ if (!defined('RX_BASEDIR') || !$addon_info->site_key || !$addon_info->secret_key
|
|||
}
|
||||
|
||||
$current_action = Context::get('act');
|
||||
$current_member = Context::get('logged_info');
|
||||
|
||||
if ($addon_info->use_signup === 'Y' && preg_match('/^(?:disp|proc)Member(?:SignUp|Insert)/i', $current_action))
|
||||
if ($current_member->is_admin === 'Y')
|
||||
{
|
||||
$enable_captcha = false;
|
||||
}
|
||||
elseif ($addon_info->target_users !== 'everyone' && $current_member->member_srl)
|
||||
{
|
||||
$enable_captcha = false;
|
||||
}
|
||||
elseif ($addon_info->target_frequency !== 'every_time' && isset($_SESSION['recaptcha_authenticated']) && $_SESSION['recaptcha_authenticated'])
|
||||
{
|
||||
$enable_captcha = false;
|
||||
}
|
||||
elseif ($addon_info->use_signup === 'Y' && preg_match('/^(?:disp|proc)Member(?:SignUp|Insert)/i', $current_action))
|
||||
{
|
||||
$enable_captcha = true;
|
||||
}
|
||||
|
|
@ -42,7 +55,3 @@ if ($enable_captcha)
|
|||
Context::set('captcha', new reCAPTCHA());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class reCAPTCHA
|
|||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['recaptcha_authenticated'] = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue