Jump to content

Renaming index.php breaks captcha


Recommended Posts

I need to rename the whmcs index.php to something else such as hosting.php. The problem that I am having with this is that it breaks the Six theme captcha. This is necessary as we will be using a different (custom) index page. See my attached screen shots for more details.The same issue exists in v6.3.1 and v7.0.0.

 

Named index.php

whmcs_index_php.JPG

 

Same file, just renamed to hosting.php

whmcs_index_php_renamedto_hosting_php.JPG

 

The index.php and hosting.php are the stock index.php from whmcs v7.0.0. They are exactly the same. It is basically two copies of index.php (one by the default name index.php, and another that is renamed hosting.php). Notice the difference in the captcha part on the two pages. For some reason it does not display the same on both pages, even though they are essentially the same page.

Link to comment
Share on other sites

use the {debug} tag inside your template/header.tpl to find out the variables passed to index.php file, then compare it with the ones passed to hosting.php, likely hosting.php will have less variables/settings than index.php.

 

you will need to define those settings/variables in hosting.php to work properly

Link to comment
Share on other sites

changing index.php to hosting.php in v7 didn't affect recaptcha for me - other than alignment is slightly off... :?:

 

what you might need to do is tweak /templates/six (or custom)/includes/captcha.tpl and change the two references of...

 

        {if $filename == 'index'}

to...

        {if $filename == 'hosting'}

and see if that fixes the issue. :idea:

Link to comment
Share on other sites

I have it fixed. I found that in the captcha.tpl and changed it. Thanks brian! I started with...

 

{if $filename == 'index' || $filename == 'hosting' }

 

That will allow it either file. I ended up expanding this to allow for all pages that have the captcha so that version 2 would work. They kept pulling version 1 on other pages such as contact, register, supporttickets, etc. Here is what I ended up with...

 

On the first one...

{if $filename == 'domainchecker' || $filename == 'index' || $filename == 'hosting' || $filename == 'submitticket' || $filename == 'register' || $filename == 'contact'}

 

On the other two...

{if $filename == 'index' || $filename == 'hosting' || $filename == 'submitticket' || $filename == 'register' || $filename == 'contact'}

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