detain / myadmin-cpanel-licensing
Cpanel Licensing Class
Package info
github.com/myadmin-plugins/cpanel-licensing
Type:myadmin-plugin
pkg:composer/detain/myadmin-cpanel-licensing
Requires
- php: >=5.0.0
- ext-soap: *
- detain/myadmin-cpanel-licensing: dev-master
- detain/myadmin-plugin-installer: dev-master
- symfony/event-dispatcher: >=2.8.26
Requires (Dev)
- codacy/coverage: dev-master
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: *
- phpunit/phpunit-mock-objects: *
- satooshi/php-coveralls: *
- vlucas/phpdotenv: *
This package is auto-updated.
Last update: 2026-03-19 15:45:15 UTC
README
A MyAdmin plugin that integrates cPanel license management into the MyAdmin billing and administration platform. It provides automated provisioning, activation, deactivation, IP changes, and billing reconciliation for cPanel licenses through the cPanel Manage2 API.
Features
- Activate and deactivate cPanel licenses via the cPanel Manage2 API
- Change the IP address associated with a cPanel license
- Verify license status for a given IP
- Retrieve license data and account lists by IP
- KernelCare and Ksplice addon license management
- Admin view of all active cPanel licenses
- Unbilled license detection and reporting
- Symfony EventDispatcher integration for the MyAdmin plugin system
Requirements
- PHP >= 5.0
- ext-soap
- symfony/event-dispatcher ^5.0
- detain/cpanel-licensing (cPanel Manage2 API wrapper)
Installation
Install with Composer:
composer require detain/myadmin-cpanel-licensing
Usage
The plugin registers itself with the MyAdmin framework through event hooks. It is loaded automatically by the plugin system when installed.
Plugin Hooks
The plugin listens on the following events:
| Event | Handler | Description |
|---|---|---|
licenses.settings |
getSettings |
Registers cPanel configuration fields |
licenses.activate |
getActivate |
Provisions a new cPanel license |
licenses.reactivate |
getActivate |
Re-provisions an expired license |
licenses.deactivate |
getDeactivate |
Expires a cPanel license |
licenses.deactivate_ip |
getDeactivateIp |
Expires a license by IP |
licenses.change_ip |
getChangeIp |
Moves a license to a new IP |
function.requirements |
getRequirements |
Registers function autoloading |
ui.menu |
getMenu |
Adds admin menu entries |
Standalone Functions
The package also provides procedural helper functions:
activate_cpanel($ip, $package)- Activate a license for an IP with a given package IDdeactivate_cpanel($ip)- Deactivate a license by IPverify_cpanel($ip)- Check if a license is activeget_cpanel_license_data_by_ip($ip)- Get full license detailsget_cpanel_licenses()- List all licenses on the accountget_cpanel_accounts_for_license_ip($ip)- Get accounts for a licensed IP
Running Tests
composer install vendor/bin/phpunit
To generate a coverage report:
vendor/bin/phpunit --coverage-html coverage/
License
This package is licensed under the LGPL-2.1 license.