source: extensions/EasyCaptcha/include/contactform.inc.php @ 28345

Last change on this file since 28345 was 28345, checked in by mistic100, 10 years ago

add 'guest_only' option

File size: 459 bytes
Line 
1<?php
2defined('EASYCAPTCHA_ID') or die('Hacking attempt!');
3
4$conf['EasyCaptcha']['template'] = 'contactform';
5include(EASYCAPTCHA_PATH.'include/common.inc.php');
6
7add_event_handler('contact_form_check', 'check_easycaptcha', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
8
9function check_easycaptcha($action, $comment)
10{
11  global $conf, $page;
12
13  if (!easycaptcha_check())
14  {
15    $page['errors'][] = l10n('Invalid answer');
16    return 'reject';
17  }
18
19  return $action;
20}
Note: See TracBrowser for help on using the repository browser.