This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Activating a License
The ActivateLicense.php file allows you to activate a license for a specific domain or device, securely communicating with the SLM Plus API. This guide will walk you through configuring and using ActivateLicense.php to manage license activation.
Prerequisites
- Ensure
CoreConfig.phpis configured with your API URL and secret key. - Confirm that
LicenseAPI.phpis included in your project, as it provides the core method for activating licenses.
How to Use ActivateLicense.php
Step 1: Set Up the Activation Data
-
Open
ActivateLicense.php. -
Define the activation data as an associative array. Here’s an example of required fields:
$activationData = [ 'license_key' => 'YOUR_LICENSE_KEY', // The license key to activate 'registered_domain' => 'example.com', // Domain to associate with the license 'registered_devices' => 'Device12345' // Optional: Device identifier ];
Adjust these fields based on the specific domain or device information you want to activate.
Step 2: Call the activate Method
-
Instantiate
ActivateLicense. -
Call the
activate()method with the$activationDataarray. Here’s how:require_once 'ActivateLicense.php';
$activateLicense = new ActivateLicense(); $activateLicense->activate($activationData);
This sends a request to activate the license on the specified domain and/or device.
Step 3: Handle the Response
ActivateLicense.php provides a response indicating the success or failure of the activation attempt. Here’s what to expect:
- Success: If activation is successful, you’ll see a message confirming activation for the specified domain and/or device.
- Error: If there’s an issue (e.g., maximum allowed domains or devices reached), an error message will be displayed.
Example Usage
Below is a complete example of using ActivateLicense.php to activate a license:
require_once 'ActivateLicense.php';
$activationData = [ 'license_key' => 'YOUR_LICENSE_KEY', 'registered_domain' => 'example.com', 'registered_devices' => 'Device12345' ];
$activateLicense = new ActivateLicense(); $activateLicense->activate($activationData);
Activation Error Handling
The ActivateLicense.php script includes specific error handling to cover scenarios like:
- Expired License: Notifies the user if the license is expired.
- Blocked License: Alerts the user if the license is blocked.
- Max Domains or Devices Reached: Provides a message if the license has reached its allowed limit of domains or devices.
For detailed response handling, review the code in ActivateLicense.php.
Next Steps
After configuring and testing license activation, you can proceed to additional actions:
Updated and maintained by Epikly