Last change
on this file since 22118 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
|
Rev | Line | |
---|
[10837] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
[19428] | 4 | include(CRYPTO_PATH.'include/common.inc.php'); |
---|
[11370] | 5 | add_event_handler('loc_end_page_header', 'add_crypto'); |
---|
| 6 | add_event_handler('register_user_check', 'check_crypto'); |
---|
[10837] | 7 | |
---|
[11370] | 8 | function add_crypto() |
---|
[10837] | 9 | { |
---|
[12617] | 10 | global $template; |
---|
[11370] | 11 | $template->set_prefilter('register', 'prefilter_crypto'); |
---|
[10837] | 12 | } |
---|
| 13 | |
---|
[11370] | 14 | function prefilter_crypto($content, $smarty) |
---|
[10837] | 15 | { |
---|
[14527] | 16 | $search = '#\(\{\'useful when password forgotten\'\|@translate\}\)(\s*)((\{/if\})?)#i'; |
---|
[19428] | 17 | $replace = '({\'useful when password forgotten\'|@translate})$1$2'."\n".'{\$CRYPTOGRAPHP}'; |
---|
[12617] | 18 | return preg_replace($search, $replace, $content); |
---|
[10837] | 19 | } |
---|
| 20 | |
---|
[11370] | 21 | function check_crypto($errors) |
---|
[10837] | 22 | { |
---|
[12617] | 23 | include_once(CRYPTO_PATH.'securimage/securimage.php'); |
---|
| 24 | $securimage = new Securimage(); |
---|
| 25 | |
---|
| 26 | if ($securimage->check($_POST['captcha_code']) == false) |
---|
[10837] | 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.