- Posts: 21
We only provide official support for Solidres's subscribers, all subscribers can request support by using forum or support ticket system. For more information please check our Support Policy at www.solidres.com/support-policy
Prevent SPAM with captcha
- Gokk
- Topic Author
- Offline
I had to implement a customized version of Securimage Captcha plugin in order to work with your extension, because of the Ajax Processing. The page that loads the Captcha image is called using Ajax therefore it wasn't display the recaptcha;
If the captcha code is valid it works, however if it is not valid it doesn't work. I'm not sure why.
The problem probably lies in the /components/com_solidres/controllers/reservation.json.php file.
In the processGuestInfo() method I have added the captcha verification and in case the Captcha code is wrong it returns this:
$response = array('status' => false, 'message' => JText::_('PLG_CAPTCHA_SECURIMAGE_VALIDATION_CODE_WRONG'), 'next_step' => 'guestinfo');
echo json_encode($response);
$this->app->close();
The Page hangs and nothing happens;
I have also changed the status to 0 instead of false for testing purposes, but it did not work either.
Can you please help?
Please Log in or Create an account to join the conversation.
- Gokk
- Topic Author
- Offline
- Posts: 21
Modification have been made to:
/administrator/components/com_solidres/config.xml (You have to configure the default captcha library OR set it up in the component options);
/components/com_solidres/layouts/asset/guestform.php (This is the Booking registration form right?);
/components/com_solidres/helpers/captcha.php (Added a captcha helper);
/components/com_solidres/controllers/reservation.json.php (Added captcha checkAnswer in the processGuestInfo() method/function)
Please Log in or Create an account to join the conversation.
- vietvh
-
- Offline
- Posts: 1553
We are glad to see you got it implemented and we appreciate your shared code. This would be useful for us when we implement Captcha for Solidres.
Regards,
Please Log in or Create an account to join the conversation.
- Gokk
- Topic Author
- Offline
- Posts: 21
Please Log in or Create an account to join the conversation.
- vietvh
-
- Offline
- Posts: 1553
Just want to make thing clear, have you done with your modification or not?
I've attached modified files! This could really help you if you plan to implement captcha in the future!
Modification have been made to:
/administrator/components/com_solidres/config.xml (You have to configure the default captcha library OR set it up in the component options);
/components/com_solidres/layouts/asset/guestform.php (This is the Booking registration form right?);
/components/com_solidres/helpers/captcha.php (Added a captcha helper);
/components/com_solidres/controllers/reservation.json.php (Added captcha checkAnswer in the processGuestInfo() method/function)
From your reply I thought your modification are done?
If you are not done with it then we will try our best to assist you.
Regards,
Please Log in or Create an account to join the conversation.
- Gokk
- Topic Author
- Offline
- Posts: 21
The post before attached files is related to my issue.From your reply I thought your modification are done?
This:
I understand how it works, but I have a problem;
I had to implement a customized version of Securimage Captcha plugin in order to work with your extension, because of the Ajax Processing. The page that loads the Captcha image is called using Ajax therefore it wasn't display the recaptcha;
If the captcha code is valid it works, however if it is not valid it doesn't work. I'm not sure why.
The problem probably lies in the /components/com_solidres/controllers/reservation.json.php file.
In the processGuestInfo() method I have added the captcha verification and in case the Captcha code is wrong it returns this:
$response = array('status' => false, 'message' => JText::_('PLG_CAPTCHA_SECURIMAGE_VALIDATION_CODE_WRONG'), 'next_step' => 'guestinfo');
echo json_encode($response);
$this->app->close();
The Page hangs and nothing happens;
I have also changed the status to 0 instead of false for testing purposes, but it did not work either.
Can you please help?
And yes, I need your help with this, I don't know what else to do, thanks.
Please Log in or Create an account to join the conversation.