Apex Managed Services Posted October 28, 2021 Share Posted October 28, 2021 Morning all, I have recently purchased the WHMCS Licensing addon and I love the way it works and will be a valid asset in times to come. I would like to know if anyone has developed anything to assist using this? and could help me out a little? I am not fluent with PHP, I know some, not a lot, but some and I want my knowledge to grow so I am not afraid of diving into stuff. But I am stuck 😄 Does anyone have a valid script that they have created or could help point me in the right direction? What I would like is when a user goes to a page - index.php for example. the script will check to see if there is a valid license there and then show them the login page, if the license is invalid or suspend or wrong IP it would them something else. What would the best way to do this be?| Any help would be great. Thanks Aaron 0 Quote Link to comment Share on other sites More sharing options...
string Posted October 28, 2021 Share Posted October 28, 2021 You find an example in your WHMCS installation how to integrate the license check, under /modules/servers/licensing/check_sample_code.php The example is not perfect and some things should/must be adjusted, but it is a pretty good starting point to see how licensing can be integrated. I think you'll be able to figure out the rest on your own, with the help of the check_sample_code.php example file. Unfortunately it is unlikely (for obvious reasons) that a developer will make his finished licensing class/functions publicly available. 0 Quote Link to comment Share on other sites More sharing options...
Apex Managed Services Posted October 28, 2021 Author Share Posted October 28, 2021 Thank you for the response. Yeh I perfectly understand that. I have been all over the sample code, but it is just for checking a license is valid or not. What I am after is if a license valid = true then direct to login page. If it = false then go to another page. Just wondered if someone had something similar? Thanks again 🙂 0 Quote Link to comment Share on other sites More sharing options...
Apex Managed Services Posted October 29, 2021 Author Share Posted October 29, 2021 OK so I think I have finally figured it out. Only issue is that when the License is suspended, I can get the page to state the license is suspended which is what I want.. But if I make the license active, the page still shows license suspended. Even though the sample code output shows that its also active. Any ideas on that one? Thanks Aaron 0 Quote Link to comment Share on other sites More sharing options...
string Posted October 30, 2021 Share Posted October 30, 2021 If the code returns that the license is valid, I would guess that you are redirecting the user to another page via HTTP status code 301 on an invalid license. This redirect is cached in the browser. If you want, send me your code via PM and I can take a look. Otherwise I unfortunately can only speculate. 0 Quote Link to comment Share on other sites More sharing options...
Apex Managed Services Posted October 31, 2021 Author Share Posted October 31, 2021 On 30/10/2021 at 1:18 PM, string said: If the code returns that the license is valid, I would guess that you are redirecting the user to another page via HTTP status code 301 on an invalid license. This redirect is cached in the browser. If you want, send me your code via PM and I can take a look. Otherwise I unfortunately can only speculate. Thank you. I would appreciate it. Its still not working correctly as I would have liked. I will send it over now Cheers 0 Quote Link to comment Share on other sites More sharing options...
Apex Managed Services Posted October 31, 2021 Author Share Posted October 31, 2021 Doesnt look like I can message you. Not sure if there is a minimum post requirement? Anyways, can you message me and I can see if I can reply? Thanks Aaron 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.