mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00: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:
parent
4828cb21cf
commit
7a2e3b4354
2 changed files with 17 additions and 0 deletions
|
@ -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?
|
// Submit report?
|
||||||
if ($submit && $reason_id)
|
if ($submit && $reason_id)
|
||||||
{
|
{
|
||||||
|
@ -224,6 +231,13 @@ display_reasons($reason_id);
|
||||||
|
|
||||||
$page_title = ($pm_id) ? $user->lang['REPORT_MESSAGE'] : $user->lang['REPORT_POST'];
|
$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(
|
$template->assign_vars(array(
|
||||||
'S_REPORT_POST' => ($pm_id) ? false : true,
|
'S_REPORT_POST' => ($pm_id) ? false : true,
|
||||||
'REPORT_TEXT' => $report_text,
|
'REPORT_TEXT' => $report_text,
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
<dt><label for="report_text">{L_MORE_INFO}:</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt>
|
<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>
|
<dd><textarea name="report_text" id="report_text" rows="10" cols="76" class="inputbox">{REPORT_TEXT}</textarea></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<!-- IF CAPTCHA_TEMPLATE -->
|
||||||
|
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
|
||||||
|
<!-- ENDIF -->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue