source: extensions/EasyCaptcha/include/guestbook.inc.php @ 26069

Revision 26069, 495 bytes checked in by mistic100, 5 years ago (diff)

try to simplify integration of captchas

Line 
1<?php
2defined('EASYCAPTCHA_ID') or die('Hacking attempt!');
3
4$conf['EasyCaptcha']['template'] = 'guestbook';
5include(EASYCAPTCHA_PATH.'include/common.inc.php');
6
7add_event_handler('user_comment_check', 'check_easycaptcha', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
8
9function 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.