source: extensions/CryptograPHP/include/contactform.inc.php @ 26413

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

try to simplify integration of captchas

File size: 604 bytes
Line 
1<?php
2defined('CRYPTO_ID') or die('Hacking attempt!');
3
4$conf['cryptographp']['template'] = 'contactform';
5include(CRYPTO_PATH.'include/common.inc.php');
6
7add_event_handler('contact_form_check', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
8
9function 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.