|
From: Meik S. <acy...@ph...> - 2009-09-01 15:08:26
|
Author: acydburn
Date: Tue Sep 1 16:08:04 2009
New Revision: 10085
Log:
Correctly assign board administrator email for L_CONFIRM_EXPLAIN in captcha plugins.
Modified:
branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/captcha_abstract.php
branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/captcha_abstract.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/captcha_abstract.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/captcha_abstract.php Tue Sep 1 16:08:04 2009
***************
*** 88,94 ****
function get_template()
{
global $config, $user, $template, $phpEx, $phpbb_root_path;
!
if ($this->is_solved())
{
return false;
--- 88,94 ----
function get_template()
{
global $config, $user, $template, $phpEx, $phpbb_root_path;
!
if ($this->is_solved())
{
return false;
***************
*** 96,103 ****
else
{
$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'];
!
$template->assign_vars(array(
'CONFIRM_IMAGE_LINK' => $link,
'CONFIRM_IMAGE' => '<img src="' . $link . '" />',
--- 96,103 ----
else
{
$link = append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=confirm&confirm_id=' . $this->confirm_id . '&type=' . $this->type);
! $explain = $user->lang(($this->type != CONFIRM_POST) ? 'CONFIRM_EXPLAIN' : 'POST_CONFIRM_EXPLAIN', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
!
$template->assign_vars(array(
'CONFIRM_IMAGE_LINK' => $link,
'CONFIRM_IMAGE' => '<img src="' . $link . '" />',
***************
*** 118,124 ****
global $config, $user, $template, $phpbb_admin_path, $phpEx;
$variables = '';
!
if (is_array($this->captcha_vars))
{
foreach ($this->captcha_vars as $captcha_var => $template_var)
--- 118,124 ----
global $config, $user, $template, $phpbb_admin_path, $phpEx;
$variables = '';
!
if (is_array($this->captcha_vars))
{
foreach ($this->captcha_vars as $captcha_var => $template_var)
***************
*** 192,198 ****
function validate()
{
global $config, $db, $user;
!
$error = '';
if (!$this->confirm_id)
{
--- 192,198 ----
function validate()
{
global $config, $db, $user;
!
$error = '';
if (!$this->confirm_id)
{
***************
*** 264,270 ****
'code' => (string) $this->code,
'seed' => (int) $this->seed)) . '
WHERE
! confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
$db->sql_query($sql);
}
--- 264,270 ----
'code' => (string) $this->code,
'seed' => (int) $this->seed)) . '
WHERE
! confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
$db->sql_query($sql);
}
***************
*** 285,297 ****
$sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
'code' => (string) $this->code,
'seed' => (int) $this->seed)) . '
! , attempts = attempts + 1
WHERE
! confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
$db->sql_query($sql);
}
!
/**
* Look up everything we need for painting&checking.
*/
--- 285,297 ----
$sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
'code' => (string) $this->code,
'seed' => (int) $this->seed)) . '
! , attempts = attempts + 1
WHERE
! confirm_id = \'' . $db->sql_escape($this->confirm_id) . '\'
AND session_id = \'' . $db->sql_escape($user->session_id) . '\'';
$db->sql_query($sql);
}
!
/**
* Look up everything we need for painting&checking.
*/
***************
*** 352,358 ****
// we leave the class usable by generating a new question
$this->generate_code();
}
!
function is_solved()
{
if (request_var('confirm_code', false) && $this->solved === 0)
--- 352,358 ----
// we leave the class usable by generating a new question
$this->generate_code();
}
!
function is_solved()
{
if (request_var('confirm_code', false) && $this->solved === 0)
***************
*** 361,367 ****
}
return (bool) $this->solved;
}
!
/**
* API function
*/
--- 361,367 ----
}
return (bool) $this->solved;
}
!
/**
* API function
*/
***************
*** 369,375 ****
{
return false;
}
!
}
?>
\ No newline at end of file
--- 369,375 ----
{
return false;
}
!
}
?>
\ No newline at end of file
Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php (original)
--- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php Tue Sep 1 16:08:04 2009
***************
*** 54,60 ****
$user->add_lang('captcha_recaptcha');
return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey']));
}
!
/**
* API function
*/
--- 54,60 ----
$user->add_lang('captcha_recaptcha');
return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey']));
}
!
/**
* API function
*/
***************
*** 143,148 ****
--- 143,150 ----
}
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(
'RECAPTCHA_SERVER' => $this->recaptcha_server,
'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '',
***************
*** 150,155 ****
--- 152,158 ----
'S_RECAPTCHA_AVAILABLE' => $this->is_available(),
'S_CONFIRM_CODE' => true,
'S_TYPE' => $this->type,
+ 'L_CONFIRM_EXPLAIN' => $explain,
));
return 'captcha_recaptcha.html';
|