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.
- 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
Install via Composer:
composer require detain/myadmin-cpanel-webhostingThe 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.menuThe 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',
]);composer install
vendor/bin/phpunitTo generate a coverage report:
vendor/bin/phpunit --coverage-textThis package is licensed under the LGPL-2.1 license.