mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-23 01:51:31 +02:00
[ticket/11566] add error functionality
add $error which stores the captcha error when captcha validation fails PHPBB3-11566
This commit is contained in:
@@ -140,8 +140,18 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'])
|
||||
$captcha->init(CONFIRM_POST);
|
||||
}
|
||||
|
||||
$error = array();
|
||||
|
||||
// Submit report?
|
||||
if ($submit && $reason_id)
|
||||
{
|
||||
$vc_response = $captcha->validate();
|
||||
if ($vc_response)
|
||||
{
|
||||
$error[] = $vc_response;
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
$sql = 'SELECT *
|
||||
FROM ' . REPORTS_REASONS_TABLE . "
|
||||
@@ -225,20 +235,23 @@ if ($submit && $reason_id)
|
||||
}
|
||||
trigger_error($message);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate the reasons
|
||||
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))
|
||||
if ((isset($captcha) && $captcha->is_solved() === false))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_CONFIRM_CODE' => true,
|
||||
'CAPTCHA_TEMPLATE' => $captcha->get_template(),
|
||||
));
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'S_REPORT_POST' => ($pm_id) ? false : true,
|
||||
'REPORT_TEXT' => $report_text,
|
||||
'S_REPORT_ACTION' => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $post_id . '&pm=' . $pm_id),
|
||||
|
Reference in New Issue
Block a user