Jump to content

Adding WHMCS Licensing Addon to custom PHP Project


Recommended Posts

First of all, i have already WHMCS in last Version. İ have a special standalone (it is not a WHMCS Modul) Client Control Panel for İPTV Bunisness. İt is codes in PHP with Bootstrap 4.

İ want use the WHMCS [Licensing Addon](https://docs.whmcs.com/Licensing_Addon) to sale this Control Panel. So it nee to be integrated on two places,

1. İn to install Script (The client need put his License Key), İf License is valid, so the installation continues. İf not, the installation will abort.

2. The entered License Key need be shown on General Settings of my PHP Script, it need be shown Licenses İnformations like License Holder Name and how long the License is valid and so one. İf the License is expired, suspended so the Login must be locked and the Licenses status information need be displayed on the login screen.

Please let me know how much this license check migration does will be cost.

Kind regards

Link to comment
Share on other sites

In modules/servers/licensing you can find check_sample_code.php. This script is commented and is all you need to understand how to configure and implement the licensing script in your module. I quote the most relevant part.

// Replace "yourprefix" with your own unique prefix to avoid conflicts with
// other instances of the licensing addon included within the same scope
function yourprefix123_check_license($licensekey, $localkey='') {

    // -----------------------------------
    //  -- Configuration Values --
    // -----------------------------------

    // Enter the url to your WHMCS installation here
    $whmcsurl = 'http://www.yourdomain.com/whmcs/';
    // Must match what is specified in the MD5 Hash Verification field
    // of the licensing product that will be used with this check.
    $licensing_secret_key = 'abc123';
    // The number of days to wait between performing remote license checks
    $localkeydays = 15;
    // The number of days to allow failover for after local key expiry
    $allowcheckfaildays = 5;

At the very end of this script you can find an example of how it can be integrated with your module. This is the basic configuration but there are some other details that you should consider.

First off obviously the licensing script and the entire module must be obfuscated otherwise people could remove your protection by simply putting ! in your if($licenseValid == true). Secondly I highly advise to implement the concept of having a local key so that your server doesn't get flood by a check-license request every time clients refresh page on your module.

Last thing. You should consider to customise the checking function and its implementation for greater security. Make it a difficult to understand / decompile.

Edited by Kian
Link to comment
Share on other sites

  • 4 weeks later...

@Kian I made a school closing system that actually uses the WHMCS licensing system, and does what you are wanting it to do.. to check if the license is valid before the install. I can help you do that! I also have IonCube if you'd like help encoding your project :) Sorry it took me so long to reply. I moved out of state to a new state and had a ton of things going on! I'm back and more than happy to assist you!

Link to comment
Share on other sites

  • 3 weeks later...

To all wondering... I've been working on scripts that have an installer and works with the licensing hand in hand. For those that need assistance or would like a build, I can assist you! The installer checks to see if an entered key is valid, and in my software scripts, I have the licensing check, so it will actively make sure the key is valid! The same works with a TRIAL license key! After the trial expires, the key expires.

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

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