mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
[ticket/12960] Add incomplete captcha to prevent registration
PHPBB3-12960
This commit is contained in:
parent
5e9d8662d1
commit
716c1ca8eb
4 changed files with 79 additions and 0 deletions
|
@ -17,6 +17,11 @@ services:
|
|||
core.captcha.plugins.incomplete:
|
||||
class: phpbb\captcha\plugins\incomplete
|
||||
shared: false
|
||||
arguments:
|
||||
- '@config'
|
||||
- '@template'
|
||||
- '%core.root_path%'
|
||||
- '%core.php_ext%'
|
||||
calls:
|
||||
- [ set_name, [ core.captcha.plugins.incomplete ] ]
|
||||
tags:
|
||||
|
|
|
@ -136,6 +136,7 @@ $lang = array_merge($lang, array(
|
|||
'CONFIRMATION' => 'Confirmation of registration',
|
||||
'CONFIRM_CHANGES' => 'Confirm changes',
|
||||
'CONFIRM_EXPLAIN' => 'To prevent automated registrations the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.',
|
||||
'CONFIRM_INCOMPLETE' => 'To prevent automated registrations the board requires you to enter a confirmation code. This has not been configured yet and hence cannot be used. Please try again later or contact the %sBoard Administrator%s.',
|
||||
'VC_REFRESH' => 'Refresh confirmation code',
|
||||
'VC_REFRESH_EXPLAIN' => 'If you cannot read the code you can request a new one by clicking the button.',
|
||||
|
||||
|
|
66
phpBB/phpbb/captcha/plugins/incomplete.php
Normal file
66
phpBB/phpbb/captcha/plugins/incomplete.php
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
namespace phpbb\captcha\plugins;
|
||||
|
||||
use phpbb\config\config;
|
||||
use phpbb\template\template;
|
||||
|
||||
class incomplete extends \phpbb\captcha\plugins\captcha_abstract
|
||||
{
|
||||
public function __construct(protected config $config, protected template $template,
|
||||
protected string $phpbb_root_path, protected string $phpEx)
|
||||
{}
|
||||
|
||||
public function is_available()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_generator_class()
|
||||
{
|
||||
}
|
||||
|
||||
public static function get_name()
|
||||
{
|
||||
return 'CAPTCHA_INCOMPLETE';
|
||||
}
|
||||
|
||||
public function init($type)
|
||||
{
|
||||
}
|
||||
|
||||
public function execute_demo()
|
||||
{
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
}
|
||||
|
||||
public function get_demo_template($id)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function get_template()
|
||||
{
|
||||
$contact_link = phpbb_get_board_contact_link($this->config, $this->phpbb_root_path, $this->phpEx);
|
||||
|
||||
$this->template->assign_vars([
|
||||
'CONFIRM_LANG' => $this->type != CONFIRM_POST ? 'CONFIRM_INCOMPLETE' : 'POST_CONFIRM_INCOMPLETE',
|
||||
'CONTACT_LINK' => $contact_link,
|
||||
]);
|
||||
|
||||
return 'captcha_incomplete.html';
|
||||
}
|
||||
|
||||
public function validate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function is_solved()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
7
phpBB/styles/prosilver/template/captcha_incomplete.html
Normal file
7
phpBB/styles/prosilver/template/captcha_incomplete.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<div class="panel captcha-panel">
|
||||
<div class="inner">
|
||||
|
||||
<h3 class="captcha-title">{{ lang('CONFIRMATION') }}</h3>
|
||||
<p class="error">{{ lang(CONFIRM_LANG, '<a href="' ~ CONTACT_LINK ~ '">', '</a>') }}</p>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Reference in a new issue