ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder

Validating a license file beforehand

Author Message
Fresshness



Joined: 02 Feb 2006
Posts: 26

PostPosted: Tue Mar 07, 2006 3:04 am    Post subject: Validating a license file beforehand Reply with quote

My situation is that I need to be able to change/update the license file at any time.

I'm having the license file uploadable with a form, however, I need to check the validity of the uploaded license file before I actually move it to the final position, because if I would upload a bogus license file, the whole program will become non-functioning until the correct license file is put back manually.

My question would be if there is a way to check the validity of a license file, before actually installing it. Is there an Ioncube API function for this?

Thanks
Back to top
View user's profile Send private message
Fresshness



Joined: 02 Feb 2006
Posts: 26

PostPosted: Wed Mar 08, 2006 1:27 am    Post subject: Reply with quote

can the function ioncube_file_is_encode() check for invalid (encoded) license files? If so, that would be good enough.

is it therefor possible to use for example this:

Code:

if(ioncube_file_is_encoded("/tmp/uploaded_license.file")) {
   // a valid license file
} else {
   // an invalid license file
}
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Wed Mar 08, 2006 2:01 pm    Post subject: Reply with quote

Hi

The ioncube_file_is_encoded() function is for calling by a script to tell whether it is encoded or not. It's not for validating files.

There is another function called ioncube_license_matches_server(), and this returns FALSE if the calling script is encoded, requires a license, and if the license is not satisfied by the server settings.

To use this, the calling encoded file must have license checking set to script, so that the calling file will still run even if the license is not valid.

You could restrict all of your application with script checking rather than Loader checking, but you need to be careful as the scripts will still run if the license is invalid. It's up to your application to use the API function above and act accordingly. Safer would be to encode a script that could check the license validity.

License files are searched for starting at the first script that needs it, and so to test a new license file, you could put it in a subdirectory along with the tester script to check it, and then move it or have the customer copy it from the drop area to the main license location once it's been shown to be valid.
_________________
Community Admin
Back to top
View user's profile Send private message
Fresshness



Joined: 02 Feb 2006
Posts: 26

PostPosted: Wed Mar 08, 2006 2:47 pm    Post subject: Reply with quote

Thanks for your information!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum