Last change
on this file since 26069 was
26069,
checked in by mistic100, 10 years ago
|
try to simplify integration of captchas
|
File size:
497 bytes
|
Line | |
---|
1 | <?php |
---|
2 | defined('EASYCAPTCHA_ID') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | $conf['EasyCaptcha']['template'] = 'contactform'; |
---|
5 | include(EASYCAPTCHA_PATH.'include/common.inc.php'); |
---|
6 | |
---|
7 | add_event_handler('contact_form_check', 'check_easycaptcha', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
8 | |
---|
9 | function check_easycaptcha($action, $comment) |
---|
10 | { |
---|
11 | global $conf, $page; |
---|
12 | |
---|
13 | if (!is_a_guest()) return $action; |
---|
14 | |
---|
15 | if (!easycaptcha_check()) |
---|
16 | { |
---|
17 | $page['errors'][] = l10n('Invalid answer'); |
---|
18 | return 'reject'; |
---|
19 | } |
---|
20 | |
---|
21 | return $action; |
---|
22 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.