Jump to content

Licensing Addon and CRON


svoorhees

Recommended Posts

Hello,

 

I have a script that was developed, and we integrated the WHMCS Licensing Addon to the scripts index.php, which is the primary program.

 

From browser, the code runs fine and the licensing addon is functioning perfectly. However, if index.php is set up as a cron job, which most users will end up doing, the error "You have an invalid license key. Please make sure your license is current and you are using the exact license given to you."

 

Again, it works fine in a browser (htttp://domain/path/index.php) but errors when running from cron.

 

Any suggestions on what might be causing this failure?

Link to comment
Share on other sites

  • 10 months later...

Via cronjob can not validate the "domain"

so you should skip checking the domain part. this may works

 

$domain=(isset($_SERVER['SERVER_NAME']))?$_SERVER['SERVER_NAME']:'';

$validdomains = explode(",",$results["validdomain"]);

if (!empty($domain) && !in_array($domain, $validdomains)) {

$localkeyvalid = false;

$localkeyresults["status"] = "Invalid";

$results = array();

}

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