detain / myadmin-cpanel-webhosting
MyAdmin cPanel Webhosting Plugin - Provides cPanel and WHM integration for the MyAdmin control panel, including account provisioning, DNS management, reseller configuration, and XML-API client functionality.
Package info
github.com/myadmin-plugins/cpanel-webhosting
Type:myadmin-plugin
pkg:composer/detain/myadmin-cpanel-webhosting
Requires
- php: >=5.0.0
- ext-soap: *
- 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:56:34 UTC
README
A MyAdmin plugin that provides full cPanel and WHM integration for webhosting management. This package handles account provisioning, suspension, reactivation, termination, DNS zone management, reseller configuration, package management, and SSL certificate operations through the cPanel XML-API.
Features
- Account Management - Create, suspend, unsuspend, and terminate cPanel hosting accounts
- Reseller Support - Full reseller account setup with ACL configuration and account limits
- DNS Management - Add, edit, and remove DNS zones and records
- Package Management - Create, edit, delete, and list hosting packages
- SSL Certificate Management - Generate, install, and list SSL certificates
- Auto-Login - API endpoint for automatic cPanel login via session tokens
- XML-API Client - Complete PHP client for the cPanel/WHM XML-API with curl and fopen support
- Event-Driven Architecture - Integrates with Symfony EventDispatcher for modular hook-based operation
Installation
Install via Composer:
composer require detain/myadmin-cpanel-webhosting
Usage
Plugin Registration
The plugin registers event hooks automatically through the getHooks() method:
use Detain\MyAdminCpanel\Plugin; $hooks = Plugin::getHooks(); // Returns hook mappings for: settings, activate, reactivate, // deactivate, terminate, api.register, function.requirements, ui.menu
XML-API Client
The included xmlapi class provides direct access to the cPanel/WHM XML-API:
$whm = new xmlapi('your-server-ip'); $whm->set_port('2087'); $whm->set_protocol('https'); $whm->set_output('json'); $whm->hash_auth('root', $accessHash); // List accounts $accounts = $whm->listaccts(); // Create an account $whm->createacct([ 'username' => 'newuser', 'password' => 'securepass', 'domain' => 'example.com', ]);
Running Tests
composer install vendor/bin/phpunit
To generate a coverage report:
vendor/bin/phpunit --coverage-text
License
This package is licensed under the LGPL-2.1 license.