forked from paxed/rash-qdb-fork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basecaptcha.php
36 lines (31 loc) · 816 Bytes
/
basecaptcha.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
abstract class baseCAPTCHA {
private $settings = null;
function init_settings($settings)
{
$this->settings = $settings;
}
function check_passthru($type)
{
if (!isset($this->settings) || !isset($this->settings[$type]) || ($this->settings[$type] == 0)) return 1;
return 0;
}
function get_CAPTCHA($type)
{
if ($this->check_passthru($type)) return '';
/* should return a string containing the CAPTCHA html, maybe a form, or whatever */
return '';
}
function check_CAPTCHA($type)
{
if ($this->check_passthru($type)) return 0;
/* checks whether the CAPTCHA was correct.
Return values:
0 = CAPTCHA was correct
1 = CAPTCHA answer was wrong
2 = CAPTCHA question was wrong (spoofed?)
3 = There's no CAPTCHA
*/
return 0;
}
}