ReCaptcha plugin problem

  • Posts: 3
  • Thank you received: 0
11 years 3 months ago #147779

-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.2.2

Hi, I have problem with hikashop recaptcha plugin. It is giving me "The CAPTCHA solution was incorrect" even thou it is correct (recaptcha server answered with success). Also is there way to put recaptcha image under whole form rather than after password?

And I know I should answer this in Joomla forum but maybe you know answer. Is joomla's native recaptcha doing check in every form? I mean why it is checking hikashop forms even when there is no code(didn't find any) to tell recaptcha plugin to check (the problem, that joomla recaptcha plugin is doing check but no picture in form showing)

Other thing, If put recaptcha (without hikashop recaptcha plugin) in checkout registration like this(or similar):

JPluginHelper::importPlugin('captcha');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onInit','dynamic_recaptcha_1');
$captcha = $dispatcher->trigger('onDisplay','dynamic_recaptcha_1');
echo $captcha[0];
it is working quite well, but there is problem, that login and registration is in the same form specifically this one
<form action="/wiseweb-test/index.php/component/hikashop/checkout/step/step-1?Itemid=242" method="post" name="hikashop_checkout_form" enctype="multipart/form-data" onsubmit="if('function' == typeof(hikashopSubmitForm)) { hikashopSubmitForm('hikashop_checkout_form'); return false; } else { return true; }">
so it is doing check also on login(which I don't want :silly: )...is there any way?

Thank you.

P.S.: Preview here in forum didn't work for me ;)

Last edit: 11 years 3 months ago by alulord.

Please Log in or Create an account to join the conversation.

  • Posts: 83989
  • Thank you received: 13604
  • MODERATOR
11 years 3 months ago #148589

Hi,

If you get an error with the recaptha solution, it means that you still have some joomla recaptcha option turned on either in the joomla user manager options or the joomla recaptcha plugin.
Only the Hikashop recaptcha plugin should be activated if you want that to work properly.

The joomla recaptcha plugin is doing its check on the event "before a user is registered" and not on an event "before the controller saving the registration form of Joomla". That why it is interfering with the recaptcha plugin that we provide since we also trigger the "before a user is registered" trigger during the registration process on HikaShop's checkout.

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
11 years 3 months ago #148595

Hi, that really was the problem. Turned out, K2 was also doing the check even when recaptcha plugins were disabled :/

However I did a small workaround. I moved the recaptcha check to registration function of your user class like this(so I don't have to change the controllers of normal user registration and checkout)

function register(&$checkout,$page='checkout',$redirect=true){
		$config =& hikashop_config();
		$app = JFactory::getApplication();

		$user 		= clone(JFactory::getUser());
		$authorize	= JFactory::getACL();
		$simplified = $config->get('simplified_registration',0);
		$post = JRequest::get('post');
		$dispatcher = JEventDispatcher::getInstance();
		JPluginHelper::importPlugin('captcha');
		$res = $dispatcher->trigger('onCheckAnswer',$post['recaptcha_response_field']);
		if(!$res[0]){	
			return false;
		}
and called recaptcha in registration form like I wrote in previous message. Working quite good for me now. However you have whole plugin for that so probably it's not an optimal solution(don't what will happen if I decide to disable recaptcha), so if you have any comments, they are welcomed ;)

Last edit: 11 years 3 months ago by alulord.

Please Log in or Create an account to join the conversation.

  • Posts: 83989
  • Thank you received: 13604
  • MODERATOR
11 years 2 months ago #148650

Hi,

If you disable the plugin, it won't display the captcha, but you'll still have the check in the controller and it won't work. So in that case you would have to remember to also remove the code in the controller.

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
11 years 2 months ago #148693

Hi, that was also my guess, but that can be fixed with simple if condition.

Another thing I found in login. Is hikashop supporting two factor authentication? (didn't find anything around web about it, but don't want to start new thread for a simple question:)

Please Log in or Create an account to join the conversation.

  • Posts: 83989
  • Thank you received: 13604
  • MODERATOR
11 years 2 months ago #148731

It doesn't.

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum