aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/captcha
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2009-06-25 08:26:51 +0000
committerHenry Sudhof <kellanved@phpbb.com>2009-06-25 08:26:51 +0000
commitb4c17b3732659991e979b989327fe375a9218df0 (patch)
treea03534c732bbc7936a908edd4b6657f110f15a6b /phpBB/includes/captcha
parent9c795870f9c8d5569365d9df9cc7207988dcb609 (diff)
downloadforums-b4c17b3732659991e979b989327fe375a9218df0.tar
forums-b4c17b3732659991e979b989327fe375a9218df0.tar.gz
forums-b4c17b3732659991e979b989327fe375a9218df0.tar.bz2
forums-b4c17b3732659991e979b989327fe375a9218df0.tar.xz
forums-b4c17b3732659991e979b989327fe375a9218df0.zip
We have to use the documented API
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9672 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/captcha')
-rw-r--r--phpBB/includes/captcha/plugins/captcha_abstract.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/includes/captcha/plugins/captcha_abstract.php b/phpBB/includes/captcha/plugins/captcha_abstract.php
index 6962100945..e23cfd0de0 100644
--- a/phpBB/includes/captcha/plugins/captcha_abstract.php
+++ b/phpBB/includes/captcha/plugins/captcha_abstract.php
@@ -30,7 +30,7 @@ class phpbb_default_captcha
var $seed;
var $attempts = 0;
var $type;
- var $solved = false;
+ var $solved = 0;
var $captcha_vars = false;
function init($type)
@@ -223,7 +223,7 @@ class phpbb_default_captcha
$this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->confirm_id = md5(unique_id($user->ip));
$this->seed = hexdec(substr(unique_id(), 4, 10));
- $this->solved = false;
+ $this->solved = 0;
// compute $seed % 0x7fffffff
$this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
@@ -246,7 +246,7 @@ class phpbb_default_captcha
$this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->seed = hexdec(substr(unique_id(), 4, 10));
- $this->solved = false;
+ $this->solved = 0;
// compute $seed % 0x7fffffff
$this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
@@ -268,7 +268,7 @@ class phpbb_default_captcha
$this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->seed = hexdec(substr(unique_id(), 4, 10));
- $this->solved = false;
+ $this->solved = 0;
// compute $seed % 0x7fffffff
$this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff);
@@ -342,6 +342,16 @@ class phpbb_default_captcha
// we leave the class usable by generating a new question
$this->generate_code();
}
+
+ function is_solved()
+ {
+ if ($this->solved === 0)
+ {
+ $this->validate();
+ }
+ return (bool) $this->solved;
+ }
+
}
?> \ No newline at end of file