iono Documentation - Other Integration Methods
iono allows your customers to buy and download your product. Licenses can be active, disabled, suspended or expired. The iono integration code allows your product to respond to the license status. There are several ways in which you can integrate your product. With each one, a license key specific to each license must be entered. This uniquely identifies the license within your iono installation. There are several options for integrating your product into iono:
The code generated for these integration options is very simple. For more flexibility and our recommended method, see the Local License Keys section.
Methods
- Per Page - A request is sent to your iono installation on every page load to check whether the license is valid or not. If so, the script continues to execute but if not it will terminate with an error.
- Per Page (Bind License) - Same as above but if this is the first access, the license will be bound (registered) to the hostname and IP address being used.
- Installation - When called, the validate the license and also increment the installation counter for that license. If you have set an install limit it will enforce this limit if reached.
- Installation (Bind License) - Same as above but if this is the first access, the license will be bound (registered) to the hostname and IP address being used.
Disadvantages
The main problem with these integration methods is that in order to validate the license, a request must be sent from the customer's server to your own server. If the request cannot be sent or your server is down, it will return with a failure. There is also the issue of load on your server if you have a lot of requests being sent. The solution to this is to use the local license keys integration method instead.
Integration
Generate Code
All of these methods are implemented using procedural code. You must first generate the code to insert into your product.
- Click on the Integration button from the iono admin control panel main menu and select Licensing Integration
- The page will change to an integration type selection screen. Select the product you will be integrating with from the drop menu. This will allow the code to enforce the product specific license key.
You will now be presented with a number of options:
- Terminate script on license failure - If the license key that the user enters is incorrect then do you wish to terminate the execution of your product? If so, then an error message will be displayed to the user
- Terminate script on communication failure - If your product cannot communicate with your iono installation, do you want your script to terminate and display an error to the user?
- Errors - If the script terminates either for one of the above reasons or if the license is invalid (e.g. it is suspended) then an error message will be shown to the user. You can customise this error message by altering the HTML that appears in the boxes for each error message
Generated Code
You are provided with 2 text fields which contain the full PHP code that implements the licensing functionality. One of these uses fsock and the other uses cURL for the method of communication.
- fsock (link) - The socket functions are available in PHP by default and are most likely to be available to your customers. However, some systems have them disabled for security reasons.
- cURL (link) - This is a different method of communication through PHP over the internet and is often much faster and more efficient than the PHP fsock functions. However, it is not available by default in PHP and must be manually compiled in. Whilst this is the best option, it may not be available to your customers.
Once you have decided which option to use, you need to copy and paste the code into your product. Within the code, there is space for the license key. This is stored in the variable called $license_key and is essential for successful communication with iono. Every license generated for your customers has its own license key which uniquely identifies it. This is sent to your iono installation when the code is loaded to check the status of the license.
FAQ
Where is the best place to put this code?
Since this code will output an error and stop execution when there is an error, the best place is at the top of a PHP file before anything other code is executed. We recommend that you place it in some file that is essential to the functioning of your product. In the case of iono, we place this code in the admin.php file so whenever you access the admin panel, it checks the license. This means that if the license becomes invalid, the admin cannot use iono but customers are unaffected.
Do I need to encode the licensing code?
Yes. If you do not encode then it is very easy to simply remove the licensing aspect. Equally, your auth string will be publicly viewable which compromises the licensing aspects of your iono installation.
How do I collect the user's license key string?
The top part of the generated code has a line requesting you to insert the customer's license key. Instead of hard coding this into the PHP code you would more likely have it stored in a config file or in the database and retrieve it from there when calling the licensing code. In iono, we collect the string during the installation process and then store it in a config file which is then read.
What format is the key string in?
See the licensing overview for details.
Can I restrict features based on the license key?
Yes, see the licensing overview for details.
Do you offer integration assistance?
Yes we do. This is charged at £65.00 GBP for basic integration with your product. Contact us for details.