View Single Post
  #15  
Old 08-08-2017, 09:42 PM
 
susilosaja susilosaja is offline
 

Advanced Member
  
Join Date: Feb 2013
Posts: 88
 

Default Re: reCAPTCHA for X-Cart Classic

I noticed that when we disabled the recaptcha module, but still left the "enabled" setting in that module checked, it still check for the recaptcha. The user is then unable to pass the recaptcha check, even though there's no recaptcha on the form.

So on the php file, I add the checking whether the module is active. For example in register.php :

// reCAPTCHA
if ($current_area == 'C' && $main != 'checkout' && $config['reCAPTCHA']['reCAPTCHA_enabled'] == "Y" && $config['reCAPTCHA']['reCAPTCHA_site_key'] && $config['reCAPTCHA']['reCAPTCHA_secret_key']) {
include $xcart_dir . '/modules/reCAPTCHA/recaptcha_check_register.php';
}
// /reCAPTCHA

I change it to :

// reCAPTCHA
if ($current_area == 'C' && $main != 'checkout' &&
!empty($active_modules["reCAPTCHA"]) && $config['reCAPTCHA']['reCAPTCHA_enabled'] == "Y" &&
$config['reCAPTCHA']['reCAPTCHA_site_key'] && $config['reCAPTCHA']['reCAPTCHA_secret_key'])
{
include $xcart_dir . '/modules/reCAPTCHA/recaptcha_check_register.php';
}
// /reCAPTCHA
__________________
Susilo
X-Cart 4.7.6 Gold Plus
Template : Ultra Responsive Template
Search module : Cloud Search
PHP 7
Reply With Quote