Jump to content

WHMCS + Joomla + IFrame = Almost working


Recommended Posts

Hello

 

I've got almost all of WHMCS working inside a Joomla IFrame. The only thing left (I think) is a small problem with login. It will actually login but I get a double page because of redirection. If you click on any link every thing will be displayed properly however. I just need to find a way to fix this as it's a little annoying.

 

This is what I did to make it all work:

1. In .htaccess added a redirection from /whmcs to /billing/wrapper.php.

 

2. wrapper.php will "fixup" the paths and pass them on to the correct iframe wrapper url in joomla.

 

3. Now, if you go http://jdshosting.biz/whmcs'>http://jdshosting.biz/whmcs this will be redirected to /billing.html which is the wrapped url for this direct url. There are ones for clientarea.php, supporttickets.php and so on.

 

4. Next I had to edit the template files and add target="_top" to all the href's.

 

5. Also in .htaccess I added a rewrite condition to reject all the folders under whmcs folder otherwise you wont be able to call the /admin as well as images and css and other files can not be found because of the /billing redirection.

 

6. And important step was to fix the endless redirection problem. Any link to /whmcs will get redirection to /billing, the wrapper link will fire and then call the original /whmcs link which will cause another redirection and another. What I did to solve this was for each wrapper url, add a variable such as:

 

/whmcs/clientarea.php?jds=foobar

 

in .htaccess I added a condition to reject if "foobar" exist thus preventing the endless redirection.

 

7. The only redirections that I could not do where:

a) viewinvoices.php since it displays in a different window and will mess up paypal if it's in a iframe

b) viewemail.php since it displays in a different window. To make email work I had to add "wrapper#" along with "foobar" so that the window will popup and not try to display the main site

 

8. I let WHMCS be in control and display inside Joomla's content area. Joomla will be used to display extra content with no login. The in result of all of this is a really good and complete joomla iframe integration (I think).

 

9. The only problem I'm having so far is finding a way to prevent login from creating a frame within a frame. It only does it once and if you click on any link things will display correctly afterward. The problem I think is that there is another call being redirected (a sub call from within WHMCS) which I can not flag so it gets redirected again. I spent most of today trying to get this solved to no avail. Any help/advice appreciated. One thing I discovered is that if I add

 

RewriteCond %{IS_SUBREQ} true

 

to .htaccess then the login will work correctly. The problem is that it will only be valid during a sub request (login, passwordreminder, etc) and will prevent redirection at any other time. In other words, if the above is added and you browse to http://jdshosting.biz/whmcs'>http://jdshosting.biz/whmcs then there will be no redirection. I've not figured out a way to setup the rules so that it's works at the right place. Sigh... been sorta struggling with regex and related stuff trying to get the right rules.

 

10. Note, the site is very much under construction at the moment. I'm simply using the template from my main site as a starting point to get the integration worked out.

 

http://jdshosting.biz

 

Thanks

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