Ignore:
Timestamp:
Dec 21, 2013, 6:39:06 PM (10 years ago)
Author:
mistic100
Message:

try to simplify integration of captchas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/CryptograPHP/include/contactform.inc.php

    r26066 r26072  
    22defined('CRYPTO_ID') or die('Hacking attempt!');
    33
     4$conf['cryptographp']['template'] = 'contactform';
    45include(CRYPTO_PATH.'include/common.inc.php');
    5 add_event_handler('loc_begin_index', 'add_crypto');
     6
    67add_event_handler('contact_form_check', 'check_crypto', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
    7 
    8 function add_crypto()
    9 {
    10   global $template;
    11   $template->set_prefilter('contactform', 'prefilter_crypto');
    12 }
    13 
    14 function prefilter_crypto($content, $smarty)
    15 {
    16   $search = '{$contact.content}</textarea></td>';
    17   return str_replace($search, $search."\n{\$CRYPTOGRAPHP}", $content);
    18 }
    198
    209function check_crypto($action, $comment)
Note: See TracChangeset for help on using the changeset viewer.