Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Image verification on Gift Certificates form Rate Topic   * * * * * 1 votes

 

Posted 28 January 2013 - 12:31 PM #1

Hi there,

One of my clients has issue about the Gift certificates. I think a spam robot attacted the GC create form, and put a lot of GC to the cart.
We made an image verification to the GC page, so the robot cannot access to that function.

The solution:

controller file:
/addons/gift_certificates/controllers/gift_certificates.php

Insert the following code after the:
if ($mode == 'add') {
line
code:

        if (fn_image_verification('gift_certificate_validate', empty($_REQUEST['verification_answer']) ? '' : $_REQUEST['verification_answer']) == false) {
            fn_save_post_data();
            if (defined('AJAX_REQUEST')) {
                exit();
            } else {
                return array(CONTROLLER_STATUS_REDIRECT, "gift_certificates.add");
            }
            
        }

Template file:
/skins/YOURSKIN/addons/gift_certificates/views/gift_certificates/update.tpl

insert this line of code before the

<div class="buttons-container">

code:
{include file="common_templates/image_verification.tpl" id="gift_certificate_validate"}