Re: Support Thread for Google reCAPTCHA plugin
Jim, suggested change on latest version: documentation says that if $publickey is missing, it will auto disable. This is not quite so. It will not appear on the form pages but the check will still be done and will fail. To complete this feature, change
classes/observers/class.google_recaptcha.php
in the constructor right before the attach to do:
if (empty($publickey)) $pages_to_check = array();
Tested and verified in 1.5.6c.
Re: Support Thread for Google reCAPTCHA plugin
Quote:
Originally Posted by
swguy
Jim, suggested change on latest version: documentation says that if $publickey is missing, it will auto disable. This is not quite so. It will not appear on the form pages but the check will still be done and will fail. To complete this feature, change
classes/observers/class.google_recaptcha.php
in the constructor right before the attach to do:
if (empty($publickey)) $pages_to_check = array();
Tested and verified in 1.5.6c.
Thanks Scott. I'll be sure this gets into the next release.
Re: Support Thread for Google reCAPTCHA
Hi All,
I am having an issue with Bots I believe creating new accounts on my 1.3.9h system, which has been running just fine now for a while. I read through the entire thread here and didn't see or find anything related to the issue that I am having.
I have followed the instructions, and I believe that I have everything alright, but after loading the files up and modifying them as necessary, when reloading the main store page, I just get a blank page. Checking the logs, I get the following error message:
[15-Oct-2019 19:46:53] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home1/bnmhobbi/public_html/store/includes/classes/observers/class.google_recaptcha.php on line 31
[15-Oct-2019 19:46:53] PHP Parse error: syntax error, unexpected T_STRING in /home1/bnmhobbi/public_html/store/includes/classes/observers/class.google_recaptcha.php on line 31
I can't for the life of me figure out what is wrong. If I remove all the files I upload, and revert back the files that I update manually, everything starts working again. Anyone got any idea on where to look here.
Also, where should the following be added tot he template files.
Code:
<?php echo recaptcha_get_html(); ?>
James
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
a02l1zz
Hi All,
I am having an issue with Bots I believe creating new accounts on my 1.3.9h system, which has been running just fine now for a while. I read through the entire thread here and didn't see or find anything related to the issue that I am having.
I have followed the instructions, and I believe that I have everything alright, but after loading the files up and modifying them as necessary, when reloading the main store page, I just get a blank page. Checking the logs, I get the following error message:
[15-Oct-2019 19:46:53] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home1/bnmhobbi/public_html/store/includes/classes/observers/class.google_recaptcha.php on line 31
[15-Oct-2019 19:46:53] PHP Parse error: syntax error, unexpected T_STRING in /home1/bnmhobbi/public_html/store/includes/classes/observers/class.google_recaptcha.php on line 31
I can't for the life of me figure out what is wrong. If I remove all the files I upload, and revert back the files that I update manually, everything starts working again. Anyone got any idea on where to look here.
Also, where should the following be added tot he template files.
Code:
<?php echo recaptcha_get_html(); ?>
James
Hi All,
I was able to find the issue and it seems that I file had uploaded that was Zero Bytes, reloading the file solved the issue, and now the Captcha option is showing up. The issue is that it is showing up in the top left corner of the page, and it malforms the look of the page. How does one include it next to the submit button. Also, once I check the "I am not a robot" option, and then click submit, it prompts me for the Captcha on a blank page, how does one fix this.
Re: Support Thread for Google reCAPTCHA
Thanks for the update on the fix.
For the placement, <?php echo recaptcha_get_html(); ?> should be inserted into the file where you want the captcha to appear. Typically, this is just before the submit button.
For the blank page, check the 'logs' folder for the error that is occurring.
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
jeking
Thanks for the update on the fix.
For the placement, <?php echo recaptcha_get_html(); ?> should be inserted into the file where you want the captcha to appear. Typically, this is just before the submit button.
For the blank page, check the 'logs' folder for the error that is occurring.
Hi Jim,
Thanks for the information. I have been looking at the create_account.php file, and the one thing I can't figure out is where the submit button is actually loaded.
Looking into the Code, I only see one line with the word "Submit" in it, as per below, but it's just a message, and not part of the code:
Code:
$messageStack->add_session('header', (defined('ERROR_CREATE_ACCOUNT_SPAM_DETECTED') ? ERROR_CREATE_ACCOUNT_SPAM_DETECTED : 'Thank you, your account request has been submitted for review.'), 'success');
So now I think I'm trying to modify the wrong page, but I can't figure out what is presenting the create_account.php layout, when that's called.
James
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
a02l1zz
Hi Jim,
Thanks for the information. I have been looking at the create_account.php file, and the one thing I can't figure out is where the submit button is actually loaded.
Looking into the Code, I only see one line with the word "Submit" in it, as per below, but it's just a message, and not part of the code:
Code:
$messageStack->add_session('header', (defined('ERROR_CREATE_ACCOUNT_SPAM_DETECTED') ? ERROR_CREATE_ACCOUNT_SPAM_DETECTED : 'Thank you, your account request has been submitted for review.'), 'success');
So now I think I'm trying to modify the wrong page, but I can't figure out what is presenting the create_account.php layout, when that's called.
James
Jim,
OK, so upon further checking, I figured out the template filename and added the respective <?php echo recaptcha_get_html(); ?> to what I thought was the right location within the file. It however, presents the Captcha box input form twice. I tried in three different locations within the form and it did the same thing. Am I missing something as to what is going on?
James
1 Attachment(s)
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
a02l1zz
Jim,
OK, so upon further checking, I figured out the template filename and added the respective <?php echo recaptcha_get_html(); ?> to what I thought was the right location within the file. It however, presents the Captcha box input form twice. I tried in three different locations within the form and it did the same thing. Am I missing something as to what is going on?
James
Jim,
This is what I am seeing on the Create Account Page:
Attachment 18690
James
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
a02l1zz
Jim,
This is what I am seeing on the Create Account Page:
Attachment 18690
James
Jim,
I am all set, I have been able to figure out where the issue was and have it down to one Captcha Box. Thanks again.
James
Re: Support Thread for Google reCAPTCHA plugin
Hi
I have an issue on my website: We are starting to receive several fake account profiles and on checking the ReCaptcha form on our contact page, message are going through withour this being checked.
Our website Is Zencart 1.5.3 on PHP 5.6 So I tried to install 3.4.1 again and I am still getting the issue.
I have tried this set up in the tpl_contact_us_default.php, tpl_modules_create_account.php and tpl_products_reviews_write_default.php, both:
Code:
<?php echo recaptcha_get_html($publickey, $resp->error,$request_type == 'SSL'); ?>
And
Code:
<?php echo recaptcha_get_html(); ?>
neither work
Theres no error logs and nothing related in the /logs/ folder
I have also set up a new Recaptcha key for shaftlimited.com and configured this new key and again this makes no difference.
The form can be viewed here https://shaftlimited.com/contact_us.html
We did migrate server about 3 months ago, but only recently has this issue come to light.
includes/modules/pages/contact_us/header_php.php around line 18 reads:
Code:
$error = false;
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
$name = zen_db_prepare_input($_POST['contactname']);
$email_address = zen_db_prepare_input($_POST['email']);
$subject = zen_db_prepare_input($_POST['subject']);
$enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));
$antiSpam = isset($_POST['should_be_empty']) ? zen_db_prepare_input($_POST['should_be_empty']) : '';
$zco_notifier->notify('NOTIFY_CONTACT_US_CAPTCHA_CHECK');
$zc_validate_email = zen_validate_email($email_address);
if ($zc_validate_email and !empty($enquiry) and !empty($name) and !empty($subject) && $error == FALSE) {
// if anti-spam is not triggered, prepare and send email:
if ($antiSpam != '') {
$zco_notifier->notify('NOTIFY_SPAM_DETECTED_USING_CONTACT_US');
} elseif ($antiSpam == '') {
// auto complete when logged in
if($_SESSION['customer_id']) {
$sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";
$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
$check_customer = $db->Execute($sql);
$customer_email= $check_customer->fields['customers_email_address'];
$customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
} else {
$customer_email = NOT_LOGGED_IN_TEXT;
$customer_name = NOT_LOGGED_IN_TEXT;
}
Please help or let me know if you need further info from me.
Many thanks in advance.