|
1 | | -# Directadmin Licensing Class |
| 1 | +# DirectAdmin Licensing Plugin for MyAdmin |
2 | 2 |
|
3 | | -Directadmin Licensing Class |
| 3 | +[](https://github.com/detain/myadmin-directadmin-licensing/actions/workflows/tests.yml) |
| 4 | +[](https://codecov.io/gh/detain/myadmin-directadmin-licensing) |
| 5 | +[](https://packagist.org/packages/detain/myadmin-directadmin-licensing) |
| 6 | +[](https://packagist.org/packages/detain/myadmin-directadmin-licensing) |
| 7 | +[](https://packagist.org/packages/detain/myadmin-directadmin-licensing) |
4 | 8 |
|
5 | | -## Build Status and Code Analysis |
| 9 | +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. |
6 | 10 |
|
7 | | -Site | Status |
8 | | ---------------|--------------------------- |
9 | | - | [](https://travis-ci.org/detain/myadmin-directadmin-licensing) |
10 | | - | [](https://codeclimate.com/github/detain/myadmin-directadmin-licensing) [](https://codeclimate.com/github/detain/myadmin-directadmin-licensing/coverage) [](https://codeclimate.com/github/detain/myadmin-directadmin-licensing) |
11 | | - | [](https://scrutinizer-ci.com/g/myadmin-plugins/directadmin-licensing/?branch=master) [](https://scrutinizer-ci.com/g/myadmin-plugins/directadmin-licensing/?branch=master) [](https://scrutinizer-ci.com/g/myadmin-plugins/directadmin-licensing/build-status/master) |
12 | | - | [](https://www.codacy.com/app/detain/myadmin-directadmin-licensing) [](https://www.codacy.com/app/detain/myadmin-directadmin-licensing?utm_source=github.com&utm_medium=referral&utm_content=detain/myadmin-directadmin-licensing&utm_campaign=Badge_Coverage) |
13 | | - | [](https://coveralls.io/github/detain/myadmin-directadmin-licensing?branch=master) |
14 | | - | [](https://packagist.org/packages/detain/myadmin-directadmin-licensing) [](https://packagist.org/packages/detain/myadmin-directadmin-licensing) [](//packagist.org/packages/detain/myadmin-directadmin-licensing) [](https://packagist.org/packages/detain/myadmin-directadmin-licensing) [](https://packagist.org/packages/detain/myadmin-directadmin-licensing) [](https://packagist.org/packages/detain/myadmin-directadmin-licensing) |
| 11 | +## Features |
15 | 12 |
|
| 13 | +- Automated license provisioning when customers purchase DirectAdmin licenses |
| 14 | +- License activation and deactivation through the DirectAdmin API |
| 15 | +- IP address change support for migrating licenses between servers |
| 16 | +- Free-tier license management for qualifying VPS packages |
| 17 | +- OS type detection and mapping for license compatibility |
| 18 | +- Admin panel integration with license management menus and settings |
| 19 | +- Payment processing for newly created licenses |
16 | 20 |
|
17 | 21 | ## Installation |
18 | 22 |
|
19 | | -Install with composer like |
| 23 | +Install with Composer: |
20 | 24 |
|
21 | 25 | ```sh |
22 | 26 | composer require detain/myadmin-directadmin-licensing |
23 | 27 | ``` |
24 | 28 |
|
25 | | -## License |
| 29 | +## Usage |
| 30 | + |
| 31 | +This 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. |
| 32 | + |
| 33 | +### Plugin Registration |
| 34 | + |
| 35 | +The plugin is auto-discovered by MyAdmin through Composer's plugin installer. It registers handlers for: |
| 36 | + |
| 37 | +- `licenses.settings` -- Admin configuration fields (API credentials, stock settings) |
| 38 | +- `licenses.activate` / `licenses.reactivate` -- License provisioning on purchase |
| 39 | +- `licenses.deactivate` / `licenses.deactivate_ip` -- License cancellation |
| 40 | +- `function.requirements` -- Lazy-loading of procedural API functions |
| 41 | + |
| 42 | +### Available Functions |
| 43 | + |
| 44 | +| Function | Description | |
| 45 | +|---|---| |
| 46 | +| `get_directadmin_license_types()` | Returns supported OS type mappings | |
| 47 | +| `activate_directadmin()` | Creates and activates a paid license | |
| 48 | +| `deactivate_directadmin()` | Cancels an active license | |
| 49 | +| `get_directadmin_licenses()` | Lists all licenses on the account | |
| 50 | +| `get_directadmin_license_by_ip()` | Finds a license by IP address | |
| 51 | +| `directadmin_modify_os()` | Changes the OS type of a license | |
| 52 | +| `activate_free_license()` | Provisions a free-tier license | |
| 53 | +| `delete_free_license()` | Removes a free-tier license | |
| 54 | + |
| 55 | +## Running Tests |
26 | 56 |
|
27 | | -The Directadmin Licensing Class class is licensed under the LGPL-v2.1 license. |
| 57 | +```sh |
| 58 | +composer install |
| 59 | +vendor/bin/phpunit |
| 60 | +``` |
| 61 | + |
| 62 | +To generate a coverage report: |
| 63 | + |
| 64 | +```sh |
| 65 | +vendor/bin/phpunit --coverage-html build/coverage |
| 66 | +``` |
| 67 | + |
| 68 | +## License |
28 | 69 |
|
| 70 | +This package is licensed under the [LGPL-2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license. |
0 commit comments