Jump to content

Disable CAPTCHA on domain checker only?


Recommended Posts

Hi there. I would like to disable captcha on the domain checker. However I would love to leave it enabled on the other places it shows up (e.g. login, etc).

 

I tried to modify the theme so that CAPTCHA is not displayed, but then it does not allow me to search. Has anyone solved this?

Link to comment
Share on other sites

we might need to know your WHMCS version and orderform template - but I think just removing the entire {if $captcha} block of code would work on v7.2 and standard_cart... or the same outcome could likely be achieved using an action hook. :idea:

<?php

function domain_register_captcha_hook($vars)
{
   if ($vars['templatefile'] == 'domainregister'){
       return array("captcha" => "");
   }
}
add_hook("ClientAreaPageCart", 1, "domain_register_captcha_hook");

Link to comment
Share on other sites

we might need to know your WHMCS version and orderform template - but I think just removing the entire {if $captcha} block of code would work on v7.2 and standard_cart... or the same outcome could likely be achieved using an action hook. :idea:

<?php

function domain_register_captcha_hook($vars)
{
   if ($vars['templatefile'] == 'domainregister'){
       return array("captcha" => "");
   }
}
add_hook("ClientAreaPageCart", 1, "domain_register_captcha_hook");

 

Thanks for the suggestion. Looks like a solid solution. However I am not that experienced with modding WHMCS. Where would I place that code?

 

ps.

Now running 7.2, last attempts I made was 6.3.

 

Per your suggestion I removed the lines from domainregister.tpl in the standard cart. This worked for the search page. Of course the captcha still displays on the homepage. After some searching I found the entry in header.tpl.

Edited by Magistar
Link to comment
Share on other sites

Thanks for the suggestion. Looks like a solid solution. However I am not that experienced with modding WHMCS. Where would I place that code?

you would create a new .php file in /includes/hooks and paste the above code into it.

 

Per your suggestion I removed the lines from domainregister.tpl in the standard cart. This worked for the search page. Of course the captcha still displays on the homepage. After some searching I found the entry in header.tpl.

I suspect you may have to remove more than just the include file if you want the homepage form to pass the search query to domain checker by changing...

 

                <form method="post" action="domainchecker.php">
                   <div class="row">
                       <div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1">
                           <div class="input-group input-group-lg">
                               <input type="text" class="form-control" name="domain" placeholder="{$LANG.exampledomain}" autocapitalize="none" />
                               <span class="input-group-btn">
                                   {if $registerdomainenabled}
                                       <input type="submit" class="btn search" value="{$LANG.search}" />
                                   {/if}
                                   {if $transferdomainenabled}
                                       <input type="submit" name="transfer" class="btn transfer" value="{$LANG.domainstransfer}" />
                                   {/if}
                               </span>
                           </div>
                       </div>
                   </div>

                   {include file="$template/includes/captcha.tpl"}
               </form>

to...

                <form method="post" action="cart.php?a=add&domain=register">
                   <div class="row">
                       <div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1">
                           <div class="input-group input-group-lg">
                               <input type="text" class="form-control" name="query" placeholder="{$LANG.exampledomain}" autocapitalize="none" />
                               <span class="input-group-btn">
                                   {if $registerdomainenabled}
                                       <input type="submit" class="btn search" value="{$LANG.search}" />
                                   {/if}
                                   {if $transferdomainenabled}
                                       <input type="submit" name="transfer" class="btn transfer" value="{$LANG.domainstransfer}" />
                                   {/if}
                               </span>
                           </div>
                       </div>
                   </div>
               </form>

Link to comment
Share on other sites

Wow amazing support!

 

I tried the hook method as replacement for the mod in domainregister.tpl and worked like a charm. Did notice that when you used the box on the homepage you had to press search manually. So I tried the header update you suggested and that problem also disappeared!

 

Thanks :).

Link to comment
Share on other sites

  • 2 years later...
45 minutes ago, Shobha Patwal said:

Where you have add the code for disabling captcha in domainregister.tpl file?

if that hook still works ono recent versions (I haven't checked), then you wouldn't add it to the template - it's an action hook and therefore you would create a .php file in /includes/hooks, give it a memorable filename and paste the code into it.

however, take a look at the reply I just posted to your similar question in another thread - that should be a better solution.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated