From 5f89b6a6d085701a0f999feb15879a62148f6fac Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 30 Jun 2009 14:00:27 +0000 Subject: [PATCH] *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 --- .../includes/captcha/plugins/captcha_abstract.php | 14 ++++++++------ .../prosilver/template/captcha_recaptcha.html | 4 ++-- 2 files changed, 10 insertions(+), 8 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' => '', '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']; diff --git a/phpBB/styles/prosilver/template/captcha_recaptcha.html b/phpBB/styles/prosilver/template/captcha_recaptcha.html index c0d4fdce98..fabbb0f277 100644 --- a/phpBB/styles/prosilver/template/captcha_recaptcha.html +++ b/phpBB/styles/prosilver/template/captcha_recaptcha.html @@ -1,4 +1,4 @@ - +
@@ -33,7 +33,7 @@ {L_RECAPTCHA_NOT_AVAILABLE} - +