From 7a2e3b4354b495f7f46bc57dfde070ce7270bd25 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Mon, 3 Jun 2013 23:38:48 +0530 Subject: [ticket/11566] add interface for captcha Add basic captcha template while reporting post when the user is not a registered user. PHPBB3-11566 --- phpBB/report.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index c1172ec1d5..06fc086d4d 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -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, -- cgit v1.2.1