1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-13 20:28:44 +01:00

[ticket/11566] add interface for captcha

Add basic captcha template while reporting post
when the user is not a registered user.

PHPBB3-11566
This commit is contained in:
Dhruv 2013-06-03 23:38:48 +05:30
parent 4828cb21cf
commit 7a2e3b4354
2 changed files with 17 additions and 0 deletions

View File

@ -133,6 +133,13 @@ else
}
}
if ($config['enable_post_confirm'] && !$user->data['is_registered'])
{
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_POST);
}
// Submit report?
if ($submit && $reason_id)
{
@ -224,6 +231,13 @@ display_reasons($reason_id);
$page_title = ($pm_id) ? $user->lang['REPORT_MESSAGE'] : $user->lang['REPORT_POST'];
if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === false))
{
$template->assign_vars(array(
'CAPTCHA_TEMPLATE' => $captcha->get_template(),
));
}
$template->assign_vars(array(
'S_REPORT_POST' => ($pm_id) ? false : true,
'REPORT_TEXT' => $report_text,

View File

@ -27,6 +27,9 @@
<dt><label for="report_text">{L_MORE_INFO}:</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt>
<dd><textarea name="report_text" id="report_text" rows="10" cols="76" class="inputbox">{REPORT_TEXT}</textarea></dd>
</dl>
<!-- IF CAPTCHA_TEMPLATE -->
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
</fieldset>
</div>