A MyAdmin plugin that integrates DirectAdmin license management into the billing and provisioning system. It supports selling, activating, deactivating, and managing both paid and free-tier DirectAdmin server and VPS licenses via the DirectAdmin API.
- Automated license provisioning when customers purchase DirectAdmin licenses
- License activation and deactivation through the DirectAdmin API
- IP address change support for migrating licenses between servers
- Free-tier license management for qualifying VPS packages
- OS type detection and mapping for license compatibility
- Admin panel integration with license management menus and settings
- Payment processing for newly created licenses
Install with Composer:
composer require detain/myadmin-directadmin-licensingThis package is designed to run within the MyAdmin hosting management platform. The Plugin class registers event hooks that the MyAdmin framework dispatches during license lifecycle operations.
The plugin is auto-discovered by MyAdmin through Composer's plugin installer. It registers handlers for:
licenses.settings-- Admin configuration fields (API credentials, stock settings)licenses.activate/licenses.reactivate-- License provisioning on purchaselicenses.deactivate/licenses.deactivate_ip-- License cancellationfunction.requirements-- Lazy-loading of procedural API functions
| Function | Description |
|---|---|
get_directadmin_license_types() |
Returns supported OS type mappings |
activate_directadmin() |
Creates and activates a paid license |
deactivate_directadmin() |
Cancels an active license |
get_directadmin_licenses() |
Lists all licenses on the account |
get_directadmin_license_by_ip() |
Finds a license by IP address |
directadmin_modify_os() |
Changes the OS type of a license |
activate_free_license() |
Provisions a free-tier license |
delete_free_license() |
Removes a free-tier license |
composer install
vendor/bin/phpunitTo generate a coverage report:
vendor/bin/phpunit --coverage-html build/coverageThis package is licensed under the LGPL-2.1 license.