mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Correctly assign board administrator email for L_CONFIRM_EXPLAIN in captcha plugins.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10085 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
254dee274c
commit
604696f9a8
2 changed files with 16 additions and 13 deletions
|
@ -88,7 +88,7 @@ class phpbb_default_captcha
|
||||||
function get_template()
|
function get_template()
|
||||||
{
|
{
|
||||||
global $config, $user, $template, $phpEx, $phpbb_root_path;
|
global $config, $user, $template, $phpEx, $phpbb_root_path;
|
||||||
|
|
||||||
if ($this->is_solved())
|
if ($this->is_solved())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -96,8 +96,8 @@ class phpbb_default_captcha
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$link = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=confirm&confirm_id=' . $this->confirm_id . '&type=' . $this->type);
|
$link = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=confirm&confirm_id=' . $this->confirm_id . '&type=' . $this->type);
|
||||||
$explain = ($this->type != CONFIRM_POST) ? sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>') : $user->lang['POST_CONFIRM_EXPLAIN'];
|
$explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'CONFIRM_IMAGE_LINK' => $link,
|
'CONFIRM_IMAGE_LINK' => $link,
|
||||||
'CONFIRM_IMAGE' => '<img src="' . $link . '" />',
|
'CONFIRM_IMAGE' => '<img src="' . $link . '" />',
|
||||||
|
@ -118,7 +118,7 @@ class phpbb_default_captcha
|
||||||
global $config, $user, $template, $phpbb_admin_path, $phpEx;
|
global $config, $user, $template, $phpbb_admin_path, $phpEx;
|
||||||
|
|
||||||
$variables = '';
|
$variables = '';
|
||||||
|
|
||||||
if (is_array($this->captcha_vars))
|
if (is_array($this->captcha_vars))
|
||||||
{
|
{
|
||||||
foreach ($this->captcha_vars as $captcha_var => $template_var)
|
foreach ($this->captcha_vars as $captcha_var => $template_var)
|
||||||
|
@ -192,7 +192,7 @@ class phpbb_default_captcha
|
||||||
function validate()
|
function validate()
|
||||||
{
|
{
|
||||||
global $config, $db, $user;
|
global $config, $db, $user;
|
||||||
|
|
||||||
$error = '';
|
$error = '';
|
||||||
if (!$this->confirm_id)
|
if (!$this->confirm_id)
|
||||||
{
|
{
|
||||||
|
@ -264,7 +264,7 @@ class phpbb_default_captcha
|
||||||
'code' => (string) $this->code,
|
'code' => (string) $this->code,
|
||||||
'seed' => (int) $this->seed)) . '
|
'seed' => (int) $this->seed)) . '
|
||||||
WHERE
|
WHERE
|
||||||
confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
|
confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
|
||||||
AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
|
AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
@ -285,13 +285,13 @@ class phpbb_default_captcha
|
||||||
$sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
|
$sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
|
||||||
'code' => (string) $this->code,
|
'code' => (string) $this->code,
|
||||||
'seed' => (int) $this->seed)) . '
|
'seed' => (int) $this->seed)) . '
|
||||||
, attempts = attempts + 1
|
, attempts = attempts + 1
|
||||||
WHERE
|
WHERE
|
||||||
confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
|
confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
|
||||||
AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
|
AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Look up everything we need for painting&checking.
|
* Look up everything we need for painting&checking.
|
||||||
*/
|
*/
|
||||||
|
@ -352,7 +352,7 @@ class phpbb_default_captcha
|
||||||
// we leave the class usable by generating a new question
|
// we leave the class usable by generating a new question
|
||||||
$this->generate_code();
|
$this->generate_code();
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_solved()
|
function is_solved()
|
||||||
{
|
{
|
||||||
if (request_var('confirm_code', false) && $this->solved === 0)
|
if (request_var('confirm_code', false) && $this->solved === 0)
|
||||||
|
@ -361,7 +361,7 @@ class phpbb_default_captcha
|
||||||
}
|
}
|
||||||
return (bool) $this->solved;
|
return (bool) $this->solved;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API function
|
* API function
|
||||||
*/
|
*/
|
||||||
|
@ -369,7 +369,7 @@ class phpbb_default_captcha
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -54,7 +54,7 @@ class phpbb_recaptcha extends phpbb_default_captcha
|
||||||
$user->add_lang('captcha_recaptcha');
|
$user->add_lang('captcha_recaptcha');
|
||||||
return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey']));
|
return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey']));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API function
|
* API function
|
||||||
*/
|
*/
|
||||||
|
@ -143,6 +143,8 @@ class phpbb_recaptcha extends phpbb_default_captcha
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'RECAPTCHA_SERVER' => $this->recaptcha_server,
|
'RECAPTCHA_SERVER' => $this->recaptcha_server,
|
||||||
'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '',
|
'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '',
|
||||||
|
@ -150,6 +152,7 @@ class phpbb_recaptcha extends phpbb_default_captcha
|
||||||
'S_RECAPTCHA_AVAILABLE' => $this->is_available(),
|
'S_RECAPTCHA_AVAILABLE' => $this->is_available(),
|
||||||
'S_CONFIRM_CODE' => true,
|
'S_CONFIRM_CODE' => true,
|
||||||
'S_TYPE' => $this->type,
|
'S_TYPE' => $this->type,
|
||||||
|
'L_CONFIRM_EXPLAIN' => $explain,
|
||||||
));
|
));
|
||||||
|
|
||||||
return 'captcha_recaptcha.html';
|
return 'captcha_recaptcha.html';
|
||||||
|
|
Loading…
Add table
Reference in a new issue