mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
38 lines
833 B
PHP
38 lines
833 B
PHP
<?php
|
|
|
|
if (!defined('RX_BASEDIR') || !$addon_info->site_key || !$addon_info->secret_key || $called_position !== 'before_module_init')
|
|
{
|
|
return;
|
|
}
|
|
|
|
if ($addon_info->use_signup === 'Y' && preg_match('/^(?:disp|proc)Member(?:SignUp|Insert)/i', Context::get('act')))
|
|
{
|
|
$enable_captcha = true;
|
|
}
|
|
elseif ($addon_info->use_recovery === 'Y' && preg_match('/^(?:disp|proc)Member(?:FindAccount|ResendAuthMail)/i', Context::get('act')))
|
|
{
|
|
$enable_captcha = true;
|
|
}
|
|
else
|
|
{
|
|
$enable_captcha = false;
|
|
}
|
|
|
|
if ($enable_captcha)
|
|
{
|
|
include_once __DIR__ . '/recaptcha.class.php';
|
|
reCAPTCHA::init($addon_info);
|
|
|
|
if (strncasecmp('proc', Context::get('act'), 4) === 0)
|
|
{
|
|
getController('module')->addTriggerFunction('moduleObject.proc', 'before', 'reCAPTCHA::check');
|
|
}
|
|
else
|
|
{
|
|
Context::set('captcha', new reCAPTCHA());
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|