Slightly Different Posted April 10, 2010 Share Posted April 10, 2010 I have purchased the licensing add on and all good but I need to have it so that on first use of my PHP software I am selling the code can update the license information (if empty) with the IP, domain and directory automatically so the software purchase and install can be fully automated. Are there any hooks into this module? How can I achieve this. Thanks Steve 0 Quote Link to comment Share on other sites More sharing options...
jeremyhaber Posted April 10, 2010 Share Posted April 10, 2010 This would be a useful feature. As far as I know this feature does not exist. The best work around is a custom script running on a cron job. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 10, 2010 Share Posted April 10, 2010 Unfortunatly no script is that clever... It needs to know what the license number is to be able to update the details of the license. 0 Quote Link to comment Share on other sites More sharing options...
Slightly Different Posted April 11, 2010 Author Share Posted April 11, 2010 Other licensing system have this. Surely all we need is a flag in the license verification to say if the licensing info is empty (IE just issued) then to populate it with those details we are just passing across. That way the first time an install is licensed and that license is verified the license take that IP, domain and directory. If building a flag in to achieve that isn't possible then how about giving an API hook into the licensing module so we can capture and act on the information passed? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 11, 2010 Share Posted April 11, 2010 You don't get what I mean or maybe I mis-interprated your question. OK... you have your script with the licensing code built in. you have it packaged up in a zip ready for a download. A client orders it... generally from their dsl/internet connection (generally not the server that the script is going to be on) client downloads and installs the script and runs it for the first time The script can get the domain, directory, ip etc but it needs a license key to be able to send that info back to the licensing server so that you know exactly who it was for or was suposed to be for. You could generate a license key from a combination of the domain,directory, and ip but how are you to know then on the licensing server who that key is for... what account do you marry it up with? Unless each download of your script has some sort of unique key to identify each script, I can't see a way to do what you want! 0 Quote Link to comment Share on other sites More sharing options...
sgrayban Posted April 11, 2010 Share Posted April 11, 2010 You can't pre insert the license key. That is stored at the end users database. 0 Quote Link to comment Share on other sites More sharing options...
Slightly Different Posted April 11, 2010 Author Share Posted April 11, 2010 Sorry, me not being clear enough. Here goes a second attempt. I create a web application, PHP, Ioncube encoded in a zip (or whatever) Client purchases this through my WHMCS install and is issued, in real time, with a license key. This license key is blank in terms of IP, domain and directory as we don't have that information at order time for all the reasons stated above. The client then installs the application on their web server which takes them through my install routine. Part of which asks them for the license key they have just purchased. At install I then want this license key to be verified against the license server (WHMCS) and if the details for the key (IP, Domain and Directory) are empty (ie it is a new and unused key) to populate that information against that license key automatically hence locking that license key to that installation automatically. I have kind of answered my own question here in that I could write a soap server that receives the key, does the checks and then populates the database directly from a soap client in the install routine but it would be much neater if this could be done through the licensing addon. All that would be needed is as bit flag in the current verify routine to say "populate if empty", value of flag if non zero indicating which if the three parts to populate and the associated code to do so. Hope that makes sense? Basically as it stands it seems to me someone can purchase a license but it isn't locked to an installation until that information is manually added by a WHMCS admin. I would just like to automate this process on installation of the sold software. 0 Quote Link to comment Share on other sites More sharing options...
sgrayban Posted April 12, 2010 Share Posted April 12, 2010 At install I then want this license key to be verified against the license server (WHMCS) and if the details for the key (IP, Domain and Directory) are empty (ie it is a new and unused key) to populate that information against that license key automatically hence locking that license key to that installation automatically. It should already do this if you followed the coding sample 0 Quote Link to comment Share on other sites More sharing options...
sgrayban Posted April 12, 2010 Share Posted April 12, 2010 (edited) The license value check is done is when they visit your addon and the first time its run its checks the license value in the hook for your addon are you using. Edited April 12, 2010 by Matt 0 Quote Link to comment Share on other sites More sharing options...
Slightly Different Posted April 12, 2010 Author Share Posted April 12, 2010 Sadly not. I've tried three different licenses and three different installs so far and each time I install my software and use the license key the first time I call the verify script using the above code it just returns that the IP is invalid and when I check the WHMCS database (mod_licensing) the IP, domain and directory are still empty for that key: <status>Invalid</status> <message>IP Address Invalid</message> I am calling $results = check_license($licensekey,''); where $licensekey is a real unused license key. 0 Quote Link to comment Share on other sites More sharing options...
sgrayban Posted April 12, 2010 Share Posted April 12, 2010 A sample hook script calling the license functions. Then in your admin module you call your hook script above once to check it.[php]include_once("../includes/hooks/myaddon.php");[/php] Don't forget your license form and database checks where the key is suppose to be stored at. 0 Quote Link to comment Share on other sites More sharing options...
Slightly Different Posted April 12, 2010 Author Share Posted April 12, 2010 Thanks for that, it's pretty much what I already have. The issue is even with that I am still getting invalid IP returned on a newly issued key that has an empty IP, Domain and Directory entry. The only way to rectify this seems to be to use WHMCS admin->Utilities->Addon Modules->Licenses Manager to manually enter in the IP, Domain and Directory once I have learnt it. It isn't added automatically the first time the license verify is called on the empty license. 0 Quote Link to comment Share on other sites More sharing options...
sgrayban Posted April 12, 2010 Share Posted April 12, 2010 Well unless you want Matt to look at your code your kinda stuck then. I have run out of help. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 12, 2010 Share Posted April 12, 2010 Sounds like you have an error in your check code somewhere. I know that you won't want to post your code here so if you like you can PM me it or contact me via msn and I'll take a quick look for you. Also make sure that you can get to the verify script on your server. eg.. http://yourdomain.com/WHMCSDIRECTORY/modules/servers/licensing/verify.php It might be that access to it is being blocked due to something in your htaccess 0 Quote Link to comment Share on other sites More sharing options...
sgrayban Posted April 12, 2010 Share Posted April 12, 2010 I was just coming back to suggest looking at a firewall -- maybe the IP that is trying to connect is blocked. 0 Quote Link to comment Share on other sites More sharing options...
Slightly Different Posted April 12, 2010 Author Share Posted April 12, 2010 Hi Guys, thanks for all the help so far, really appreciate your time. My code, for testing purposes, is the stock sample code from the module with a real license code and empty localkey variable. It posts to the verify script fine as, if I manually in WHMCS admin add the ip, domain and direcotry to the license all works well and comes back active. So the verify URL is fine, firewall is fine, etc. All looks good. The only issue I have is when I (a client) purchases a new license, which is of course empty in terms of ip domain and directory, then the client installs my software with the license key, verify is called and fails due to the license server returning invald IP as above. Once I populate the license information manually all works fine and I get an active response. It's just the automatic population of the license data on the server at install time that isn't working. Sparky, thanks for the offer of PM, will do in a few minutes. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted April 12, 2010 WHMCS CEO Share Posted April 12, 2010 It sounds like you just need to reissue the key. If the key is "Active" and no details set then they won't automatically populate, but if you hit the "Reissue" button, once in the "Reissued" status, the next location the license is used in will be the details that are saved as the valid location. It's fully automated and reissued is the default status all new licenses start out with. Matt 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 12, 2010 Share Posted April 12, 2010 Yes Matt... that is what was wrong... the license was not used as was set to active 0 Quote Link to comment Share on other sites More sharing options...
sgrayban Posted April 12, 2010 Share Posted April 12, 2010 damn I didn't even think of that one 0 Quote Link to comment Share on other sites More sharing options...
kmkswamy Posted May 21, 2010 Share Posted May 21, 2010 Hi, I am a bit stuck in this one, how should i send the the ip when i have multiple ips. case: 1. License is in Reissue state 2. Request for a verify with one ip and it works 3. Request a verify with 2 ips seperated with comma (ex : "192.111.111.11,192.111.111.12") this sends a Invalid state with message "IP Address Invalid" and the state of the license is "Active" with both the ips provided. Can anyone tell me why do i get the Invalid state as return or how to register multiple ips when license is reissued. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.