source: extensions/CryptograPHP/include/register.inc.php @ 19428

Last change on this file since 19428 was 19428, checked in by mistic100, 12 years ago

change reload icon with color choice (dark or light), separate HTML and PHP

File size: 888 bytes
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4include(CRYPTO_PATH.'include/common.inc.php');
5add_event_handler('loc_end_page_header', 'add_crypto');
6add_event_handler('register_user_check', 'check_crypto');
7
8function add_crypto()
9{
10  global $template;
11  $template->set_prefilter('register', 'prefilter_crypto');
12}
13
14function prefilter_crypto($content, $smarty)
15{
16  $search = '#\(\{\'useful when password forgotten\'\|@translate\}\)(\s*)((\{/if\})?)#i';
17  $replace = '({\'useful when password forgotten\'|@translate})$1$2'."\n".'{\$CRYPTOGRAPHP}';
18  return preg_replace($search, $replace, $content);
19}
20
21function check_crypto($errors)
22{
23  include_once(CRYPTO_PATH.'securimage/securimage.php');
24  $securimage = new Securimage();
25 
26  if ($securimage->check($_POST['captcha_code']) == false)
27  {
28    array_push($errors, l10n('Invalid Captcha'));
29  }
30
31  return $errors;
32}
33
34?>
Note: See TracBrowser for help on using the repository browser.