Remote licensing script customization
#1
Hi there

I would like to create an remote licensing script that takes its values from a combination of POST data and custom functions.

The aim is to make the delivery package accessible remotely from the command line shell.

So the on-script does its data checking and creates a command something like:

Code:
#!/bin/sh

local licenseKey="abc123"
local domainname=`cat /etc/hostname`

lynx --dump http://go.mydomain.com/api.php?licenseKey=$licenseKey&domainname=$myDomain | sh

Then in in the remote php script, we have:

Code:
<?php

$licenseKey = $_POST["licenseKey"];
$package_id = $_POST["packageNumber"];

function getRealIpAddr()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP']))   //check ip from share internet
    {
      $ipAddr=$_SERVER['HTTP_CLIENT_IP'];
    }
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))   //check whether we're using a proxy
    {
      $ipAddr=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      $ipAddr=$_SERVER['REMOTE_ADDR'];
    }
    return $ipAddr;
}

$client_ip = getRealIpAddr();

// SNIP

// If we get this far, the license is valid
// print the script to the screen

// get the script

$myFile = "./protected/sme-configure.sh";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);

// print it to the screen

echo $theData;

?>

The issue is I don't really know enough about how the API interacts with the database to make all of this work together with PHPLicengine.

If this requires some custom programming
Reply
#2
This is not possible in current version but we have it in our todo list for v2.
Thank you,
PHPLicengine Management
----------------------------------
Unsolicited PMs will be ignored. All questions must be asked in forums.
Encrypt and License your PHP script
Follow us on Facebook
Follow us on Twitter
Blog
Follow us on Google+
Reply
#3
Crumbs! How far away is v2?
Reply
#4
We don't have an ETA yet! Sad
Thank you,
PHPLicengine Management
----------------------------------
Unsolicited PMs will be ignored. All questions must be asked in forums.
Encrypt and License your PHP script
Follow us on Facebook
Follow us on Twitter
Blog
Follow us on Google+
Reply
#5
I have an idea.

What about if I wrote a script to download the various php files to /tmp/myscript and then ran them through the PHP interpreter from the command line?

Would something like that work?
Reply
#6
This will not work, you should wait for v2.
Thank you,
PHPLicengine Management
----------------------------------
Unsolicited PMs will be ignored. All questions must be asked in forums.
Encrypt and License your PHP script
Follow us on Facebook
Follow us on Twitter
Blog
Follow us on Google+
Reply
#7
Hmmm, maybe this idea could work in a modified form.

The target servers all run Apache out of the box, so we can download the necessary files to /var/www/html/temp/ (including ionCube loader)

and then run lynx --dump http://www.serverdomain.fqdn/temp/script...kageNumber=[1,2,3 whatever]

The only issue I can forsee is that the script_remote_local.php would need to be encrypted.

How does that sound?
Reply
#8
What response do you expect to get from http://go.mydomain.com/api.php?licenseKe...6;myDomain or http://www.serverdomain.fqdn/temp/script.php?ageNumber=[1,2,3 whatever]? It can response back with the generated license key that your script can save it in a file like key.php or it can response back with an xml containing validation data like ip, domain name etc. that your script can parse this xml and validate the license. Which kind of response do you need to get from api?
Thank you,
PHPLicengine Management
----------------------------------
Unsolicited PMs will be ignored. All questions must be asked in forums.
Encrypt and License your PHP script
Follow us on Facebook
Follow us on Twitter
Blog
Follow us on Google+
Reply
#9
Ideally what should happen is that it would respond with the product script, or an error if something is wrong with the licensing information.
Reply
#10
Do you mean if the license is valid, the API should respond back with source of your script (which in your example it would be "./protected/sme-configure.sh")?
Thank you,
PHPLicengine Management
----------------------------------
Unsolicited PMs will be ignored. All questions must be asked in forums.
Encrypt and License your PHP script
Follow us on Facebook
Follow us on Twitter
Blog
Follow us on Google+
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  how long to get activated for paid script mic141414 1 3,089 01-24-2012, 12:46 AM
Last Post: Admin
  Remote License Communications Question phpdog 1 3,287 09-01-2011, 01:34 AM
Last Post: Admin
  Requesting information on User Licenses, Local Licensing, Integration etc. nikhil 8 12,923 09-27-2010, 08:47 AM
Last Post: nikhil
Sad remote License are invalid xanario 9 12,272 06-26-2010, 08:48 AM
Last Post: Admin
  Can a license go local then remote? tooltrainer 5 14,872 11-01-2009, 09:42 AM
Last Post: Admin
  Setting up Remote License hayama 4 13,743 10-20-2009, 09:20 AM
Last Post: hayama

Forum Jump:


Users browsing this thread: 1 Guest(s)