Jump to content

WHMCS Licensing addon


Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 🙂

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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