set_prefilter('cf_form', 'prefilter_crypto'); } function prefilter_crypto($content, $smarty) { global $conf; $search = '   '; $replace = ' {\''.($conf['cryptographp']['captcha_type']=='string'?'Enter code':'Solve equation').'\'|@translate} CAPTCHA Image ' ."\n".$search; return str_replace($search, $replace, $content); } function check_crypto($infos) { if (!is_a_guest()) return $infos; include_once(CRYPTO_PATH.'securimage/securimage.php'); $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { array_push($infos['errors'], l10n('Invalid Captcha')); } return $infos; } ?>