mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 18:26:32 +02:00
[ticket/16105] Add domain selection to recaptcha v2 & check against list
PHPBB3-16105
This commit is contained in:
@@ -94,6 +94,12 @@ class recaptcha extends captcha_abstract
|
||||
}
|
||||
}
|
||||
|
||||
$recaptcha_domain = $request->variable('recaptcha_v2_domain', '', true);
|
||||
if (in_array($recaptcha_domain, recaptcha_v3::$supported_domains))
|
||||
{
|
||||
$config->set('recaptcha_v2_domain', $recaptcha_domain);
|
||||
}
|
||||
|
||||
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_VISUAL');
|
||||
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
|
||||
}
|
||||
@@ -110,9 +116,11 @@ class recaptcha extends captcha_abstract
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'CAPTCHA_PREVIEW' => $this->get_demo_template($id),
|
||||
'CAPTCHA_NAME' => $this->get_service_name(),
|
||||
'U_ACTION' => $module->u_action,
|
||||
'CAPTCHA_PREVIEW' => $this->get_demo_template($id),
|
||||
'CAPTCHA_NAME' => $this->get_service_name(),
|
||||
'RECAPTCHA_V2_DOMAIN' => $config['recaptcha_v2_domain'] ?? recaptcha_v3::GOOGLE,
|
||||
'RECAPTCHA_V2_DOMAINS' => recaptcha_v3::$supported_domains,
|
||||
'U_ACTION' => $module->u_action,
|
||||
));
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user