Error submitting form!
Please make sure both javascript and cookies are enabled in your browser.
Use the back button to try again...
(Note: if this still doesn't help, then refreshing your cache might)", 'anti_captcha'));
add_action('login_head', 'anti_captcha_head');
//add_action('wp_authenticate', 'anti_captcha_process_login');
add_action('wp_head', 'anti_captcha_head');
add_action('register_post','anti_captcha_process_registration',10,3);
add_action('lostpassword_post','anti_captcha_process_lostpassword',10,3);
add_filter('preprocess_comment', 'anti_captcha_process_comment');
function anti_captcha_head()
{
if (is_user_logged_in()) return;
wp_enqueue_script('anti-captcha', '/wp-content/plugins/anti-captcha/anti-captcha-0.2.js.php', array(), md5(rand(1111,9999)));
wp_print_scripts('anti-captcha');
}
function anti_captcha_verify_token($token)
{
if (sha1($token) == $_COOKIE['anti-captcha-crc']) {
setcookie ('anti-captcha-crc', sha1(rand(1111,9999)), time() + 3600, '/');
return true;
}
return false;
}
function anti_captcha_process_comment($incoming_comment)
{
if (is_user_logged_in()) return $incoming_comment;
if (!anti_captcha_verify_token($_POST['anti-captcha-token'])) {
add_filter('pre_comment_approved', create_function('$a', 'return \'spam\';'));
}
return $incoming_comment;
}
/*
function anti_captcha_process_login()
{
if (count($_POST)) {
if (!anti_captcha_verify_token($_POST['anti-captcha-token'])) {
wp_die(ANTI_CAPTCHA_ERROR);
}
}
}
*/
function anti_captcha_process_registration($login,$email,$errors)
{
if (!anti_captcha_verify_token($_POST['anti-captcha-token'])) {
$errors->add('anti_captcha_error', ANTI_CAPTCHA_ERROR);
}
}
function anti_captcha_process_lostpassword()
{
if (!anti_captcha_verify_token($_POST['anti-captcha-token'])) {
wp_die(ANTI_CAPTCHA_ERROR);
}
}