Last change
on this file since 26168 was
26072,
checked in by mistic100, 11 years ago
|
try to simplify integration of captchas
|
File size:
602 bytes
|
Line | |
---|
1 | <?php |
---|
2 | defined('CRYPTO_ID') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | $conf['cryptographp']['template'] = 'guestbook'; |
---|
5 | include(CRYPTO_PATH.'include/common.inc.php'); |
---|
6 | |
---|
7 | add_event_handler('user_comment_check', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
8 | |
---|
9 | function check_crypto($action, $comment) |
---|
10 | { |
---|
11 | global $conf, $page; |
---|
12 | |
---|
13 | include_once(CRYPTO_PATH.'securimage/securimage.php'); |
---|
14 | $securimage = new Securimage(); |
---|
15 | |
---|
16 | if (!is_a_guest()) return $action; |
---|
17 | |
---|
18 | if ($securimage->check($_POST['captcha_code']) == false) |
---|
19 | { |
---|
20 | $page['errors'][] = l10n('Invalid Captcha'); |
---|
21 | return 'reject'; |
---|
22 | } |
---|
23 | |
---|
24 | return $action; |
---|
25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.