aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/captcha/plugins/captcha_abstract.php
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2009-06-30 14:00:27 +0000
committerHenry Sudhof <kellanved@phpbb.com>2009-06-30 14:00:27 +0000
commit5f89b6a6d085701a0f999feb15879a62148f6fac (patch)
tree3939aa355b6149cc806a4f5fec2aa5ad7a7a4ca9 /phpBB/includes/captcha/plugins/captcha_abstract.php
parentc6a84179e3f24c18628c213b0a090e089a70bf71 (diff)
downloadforums-5f89b6a6d085701a0f999feb15879a62148f6fac.tar
forums-5f89b6a6d085701a0f999feb15879a62148f6fac.tar.gz
forums-5f89b6a6d085701a0f999feb15879a62148f6fac.tar.bz2
forums-5f89b6a6d085701a0f999feb15879a62148f6fac.tar.xz
forums-5f89b6a6d085701a0f999feb15879a62148f6fac.zip
*blinks* there were supposed to be more files, where are they? Ah, here
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9707 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/captcha/plugins/captcha_abstract.php')
-rw-r--r--phpBB/includes/captcha/plugins/captcha_abstract.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/includes/captcha/plugins/captcha_abstract.php b/phpBB/includes/captcha/plugins/captcha_abstract.php
index 86ecdaf97e..2a93b3f895 100644
--- a/phpBB/includes/captcha/plugins/captcha_abstract.php
+++ b/phpBB/includes/captcha/plugins/captcha_abstract.php
@@ -38,12 +38,13 @@ class phpbb_default_captcha
global $config, $db, $user;
// read input
+ $this->confirm_id = request_var('confirm_id', '');
$this->confirm_code = request_var('confirm_code', '');
$refresh = request_var('refresh_vc', false) && $config['confirm_refresh'];
$this->type = (int) $type;
- if (!$this->load_code())
+ if (!strlen($this->confirm_id) || !$this->load_code())
{
// we have no confirm ID, better get ready to display something
$this->generate_code();
@@ -95,6 +96,7 @@ class phpbb_default_captcha
'CONFIRM_IMG' => '<img src="'. $link . '" />',
'CONFIRM_ID' => $this->confirm_id,
'S_CONFIRM_CODE' => true,
+ 'S_TYPE' => $this->type,
'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false,
'L_CONFIRM_EXPLAIN' => $explain,
));
@@ -178,7 +180,7 @@ class phpbb_default_captcha
return;
}
- function validate($data = false)
+ function validate()
{
global $config, $db, $user;
@@ -204,7 +206,6 @@ class phpbb_default_captcha
{
// okay, incorrect answer. Let's ask a new question.
$this->new_attempt();
- $this->solved = false;
return $error;
}
else
@@ -277,6 +278,7 @@ class phpbb_default_captcha
'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);
}
@@ -288,9 +290,10 @@ class phpbb_default_captcha
{
global $db, $user;
- $sql = 'SELECT code, confirm_id, seed, attempts
+ $sql = 'SELECT code, seed, attempts
FROM ' . CONFIRM_TABLE . "
- WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
+ WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
+ AND session_id = '" . $db->sql_escape($user->session_id) . "'
AND confirm_type = " . $this->type;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -298,7 +301,6 @@ class phpbb_default_captcha
if ($row)
{
- $this->confirm_id = $row['confirm_id'];
$this->code = $row['code'];
$this->seed = $row['seed'];
$this->attempts = $row['attempts'];