Jump to content

Licensing Module -- making custom verification system possibly as a module


mfoland

Recommended Posts

Hello,

 

I have a website where I sell php scripts as I make them, and I'm also going to expand to web design and web hosting. However, I am making a custom license verification system, and for some reason it is not getting the domain, even though I'm getting the results from the right tables. I've had to edit Smarty to allow php templates. Would there be more feasable way if doing this not as a tpl for me to not only be able to use the php.. but use Ioncube to encrypt my coding. In mine, I'm also doing some very special things.. I'd like to possibly sell as a module for whmcs.. all pure coded by me.

 

Thanks for your help

Link to comment
Share on other sites

If you are talking about getting domain name of WHMCS I would use the value of SystemURL in tblconfiguration table. Retrieving this value from PHP could give unexpected results or nothing.

As for the rest I don't understand what you mean when you say that you had to edit Smarty to allow PHP templates. Explain?

Link to comment
Share on other sites

In a Smarty .tpl page, I use php with the <?php  and ?> tags. I've modified my Smarty.class to allow php templates and set it to PHP_ALLOW instead of passthrough. When I go to encode my script with Ioncube, the page does not load at all. It acts like it is not suppose to read php. I've tried the non encryption with ioncube with starts with !OMB etc and it just shows that text instead of decoding it. I'm not sure what's going on. I'm making this module as an upgrade to the current license verification that comes with the licensing module so folks can verify active products to a domain, and report if they are unlicensed.

Link to comment
Share on other sites

Using PHP in tpl files is probably the worst thing you can do with Smarty. It's more than just a bad practice and I'm not surpised that your page doesn't load. You are encoding the entire file (Smarty tags, CSS, javascript...) and no browser can understand ionCube. If you ask me if it's possible to achieve your goal I'd say yes. For sure there must be a way (ugly, inefficient and hard to maintain) since nothing is impossible in software development but what's the point?

In my opinion you are overcomplicating things. Even if you manage to get it work how can you pretend all your customers to adapt to all your limitations? I really don't understand why someone should put PHP code in template files. Why can't you use Smarty as it was meant to be used? It's a template engine that it's not supposed to host PHP codes. This is all you need to do. You need few minutes to get what you want.

Link to comment
Share on other sites

On 8/14/2018 at 6:38 AM, Kian said:

Using PHP in tpl files is probably the worst thing you can do with Smarty. It's more than just a bad practice and I'm not surpised that your page doesn't load. You are encoding the entire file (Smarty tags, CSS, javascript...) and no browser can understand ionCube. If you ask me if it's possible to achieve your goal I'd say yes. For sure there must be a way (ugly, inefficient and hard to maintain) since nothing is impossible in software development but what's the point?

In my opinion you are overcomplicating things. Even if you manage to get it work how can you pretend all your customers to adapt to all your limitations? I really don't understand why someone should put PHP code in template files. Why can't you use Smarty as it was meant to be used? It's a template engine that it's not supposed to host PHP codes. This is all you need to do. You need few minutes to get what you want.

@Kian I'm understanding the Creating Pages. Is there a way I can not do what I'm creating using the $ca->setTemplate? I'd like to put everything on that page, and just use ioncube to protect it. I've done research with the .tpl files, and even using the function ioncube_read_file() I get missing template, even though I specify the template.

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