A comprehensive WHMCS provisioning module for VirtFusion that enables automated VPS server provisioning, management, and client self-service directly from WHMCS.
- Requirements
- Features
- Installation
- Upgrading
- Configuration
- Client Area Features
- Admin Area Features
- Theme Compatibility
- API Endpoints Used
- Usage Update (Cron)
- Troubleshooting
- Known Issues
- Security
- Contributing
- License
| Requirement | Minimum Version | Notes |
|---|---|---|
| VirtFusion | v1.7.3+ | v6.1.0+ required for VNC console |
| WHMCS | 8.x+ | Tested with 8.0 through 8.10 |
| PHP | 8.0+ | With cURL extension enabled |
| SSL | Valid certificate | Required on VirtFusion panel |
You also need a VirtFusion API token with the following permissions:
- Server management (create, read, update, delete, power, build)
- User management (create, read, reset password, authentication tokens)
- Package and template read access
- Network management (if using IP management features)
- Automatic server creation with VirtFusion user account linking
- Server suspension, unsuspension, and termination
- Package/plan upgrades and downgrades
- Configurable options mapping for dynamic resource allocation (CPU, RAM, disk, bandwidth, network speed)
- Dry run validation - Test server creation parameters before provisioning
- Automatic memory unit conversion (GB to MB for values < 1024)
- Server Overview - Real-time server info (hostname, IPs, resources) with status badge
- Power Management - Start, restart, graceful shutdown, and force power off
- Control Panel SSO - One-click login to VirtFusion panel
- Server Rebuild - Reinstall with any available OS template
- Password Reset - Reset VirtFusion panel login credentials
- Network Management - View IPv4 addresses and IPv6 subnets with copy-to-clipboard
- Resources Panel - Current memory, CPU, storage, traffic allocation with usage bars
- VNC Console - Browser-based console access (panel auto-hides when VNC is disabled on the server)
- Self-Service Billing - Credit balance display, usage breakdown, and credit top-up (when enabled)
- Bandwidth Usage - Traffic usage display with allocation limits
- Billing Overview - Product, billing cycle, dates, and payment information
- Test Connection - Verify API connectivity from WHMCS
- Server Data Display - Live server information from VirtFusion
- Admin Impersonation - Log into VirtFusion panel as server owner
- Server ID Management - Editable Server ID for manual adjustments
- Server Object Viewer - Full JSON response from VirtFusion API
- Validate Server Config - Dry run server creation to check configuration
- Update Server Object - Refresh cached server data from VirtFusion
- OS template tile gallery with accordion categories, search, and brand icons
- SSH key selection dropdown for users with saved keys, with option to paste a new public key
- SSH Ed25519 key generator — Client-side keypair generation using Web Crypto API
- Checkout validation ensuring OS selection before order placement
- Resource sliders - Configurable option dropdowns are replaced with interactive range sliders
- Compatible with all WHMCS order form templates
- Automated bandwidth sync - WHMCS daily cron pulls traffic usage from VirtFusion
- Disk usage sync - Storage usage updated automatically
- Visible in WHMCS client area and admin product details
- Assign backup plans to servers via the VirtFusion API
- Remove backup plans from servers
- In-place modification of server resources (memory, CPU cores, traffic)
- No server rebuild required for resource changes
- Package change now also applies individual resource modifications from configurable options
- Credit balance display and top-up from client area
- Usage breakdown reporting
- Auto top-off via WHMCS cron when credit falls below threshold
- Self-service mode configurable per product (Hourly, Resource Packs, or Both)
- Automatic PTR sync on server create, rename, and terminate
- Client-editable rDNS panel in the service overview — one input per assigned IP
- Forward-confirmed reverse DNS (FCrDNS) — every PTR write requires the hostname's A/AAAA to already resolve to the IP; mismatches are rejected with a clear error
- IPv4 + IPv6 support out of the box (IPv6 nibble-reversal,
.ip6.arpazones) - RFC 2317 classless delegation — supports both CIDR-prefix (
0/26) and block-size (64/64) zone naming conventions - Admin reconciliation — a "Reconcile" button on the services tab and an additive-only daily cron that creates any missing PTRs
- Client-custom PTRs preserved across renames — only PTRs whose content matches the previous hostname get rewritten
- Auto NOTIFY + SOA bump so slaves pick up changes immediately (when
soa_edit_api=INCREASEis set on the zone) - Opt-in via a companion WHMCS addon module — no impact on existing provisioning if not activated
WHMCS=/path/to/whmcs
git clone https://github.com/EZSCALE/virtfusion-whmcs-module.git /tmp/vf \
&& rsync -ahP --delete /tmp/vf/modules/servers/VirtFusionDirect/ "$WHMCS/modules/servers/VirtFusionDirect/" \
&& rm -rf /tmp/vfSet WHMCS once at the top — it's reused in every path below. The database table, schema migrations, and custom fields are all created automatically on first load.
Then configure in WHMCS Admin:
- Add Server — Configuration > System Settings > Servers > Add New Server. Set hostname to your VirtFusion panel (e.g.
cp.example.com), type to "VirtFusion Direct Provisioning", and paste your API token in the Password field. Click Test Connection to verify. - Create Product — Configuration > System Settings > Products/Services. On the Module Settings tab, select "VirtFusion Direct Provisioning", choose your server, and set the Hypervisor Group ID, Package ID, and Default IPv4 count.
- (Optional) Install the Reverse DNS Addon — also sync the
modules/addons/VirtFusionDns/directory if you want PowerDNS-backed rDNS management. See Reverse DNS Addon (PowerDNS) below for activation and configuration.
That's it. Hooks activate automatically and custom fields are created on module load.
WHMCS=/path/to/whmcs
git clone https://github.com/EZSCALE/virtfusion-whmcs-module.git /tmp/vf \
&& rsync -ahP --delete /tmp/vf/modules/servers/VirtFusionDirect/ "$WHMCS/modules/servers/VirtFusionDirect/" \
&& rsync -ahP --delete /tmp/vf/modules/addons/VirtFusionDns/ "$WHMCS/modules/addons/VirtFusionDns/" \
&& rm -rf /tmp/vfThe second rsync line is only needed if you use the Reverse DNS addon; skip it otherwise. Addon settings live in tbladdonmodules and survive file updates.
Note: If you have a custom
config/ConfigOptionMapping.php, back it up first —--deletewill remove it. Restore it after upgrading.
If you use theme-overridden templates, review them for any new template variables. Clear the WHMCS template cache after upgrading: Configuration > System Settings > General Settings > clear template cache.
In WHMCS Admin under Configuration > System Settings > Servers:
| Field | Value |
|---|---|
| Hostname | Your VirtFusion panel domain (e.g., cp.example.com) |
| Password | Your VirtFusion API token |
| Type | VirtFusion Direct Provisioning |
Important: Do not include https:// or /api/v1 in the hostname. The module constructs the full URL automatically.
Each WHMCS product using this module needs:
- Module set to "VirtFusion Direct Provisioning"
- A linked server (or the module will use any available VirtFusion server)
- The three configuration options set (Hypervisor Group ID, Package ID, Default IPv4)
- Custom fields created (see below)
The module requires two custom fields per product: Initial Operating System and Initial SSH Key. These are automatically created when the module loads — no manual setup required.
The fields are hidden text boxes that are dynamically replaced by dropdown selects via JavaScript hooks on the order form. They are created for every product with the module type set to "VirtFusion Direct Provisioning".
Each product has three module-specific settings:
| Option | Name | Description | Default |
|---|---|---|---|
| Config Option 1 | Hypervisor Group ID | VirtFusion hypervisor group for server placement | 1 |
| Config Option 2 | Package ID | VirtFusion package defining server resources | 1 |
| Config Option 3 | Default IPv4 | Number of IPv4 addresses to assign (0-10) | 1 |
| Config Option 4 | Self-Service Mode | Enable VirtFusion self-service billing (0=Disabled, 1=Hourly, 2=Resource Packs, 3=Both) | 0 |
| Config Option 5 | Auto Top-Off Threshold | Credit balance below which auto top-off triggers during cron (0=disabled) | 0 |
| Config Option 6 | Auto Top-Off Amount | Credit amount to add when auto top-off triggers | 100 |
You can find your Hypervisor Group IDs and Package IDs in the VirtFusion admin panel.
To allow customers to select different resource levels with pricing tiers, create WHMCS Configurable Options groups with these option names:
| VirtFusion Parameter | Default Option Name | Description | Unit |
|---|---|---|---|
packageId |
Package | VirtFusion package ID | ID |
hypervisorId |
Location | Hypervisor group for placement | ID |
ipv4 |
IPv4 | Number of IPv4 addresses | Count |
storage |
Storage | Disk space | GB |
memory |
Memory | RAM (values < 1024 auto-converted from GB) | MB |
traffic |
Bandwidth | Monthly traffic allowance | GB |
cpuCores |
CPU Cores | Number of CPU cores | Count |
networkSpeedInbound |
Inbound Network Speed | Inbound speed | Mbps |
networkSpeedOutbound |
Outbound Network Speed | Outbound speed | Mbps |
networkProfile |
Network Type | VirtFusion network profile | ID |
storageProfile |
Storage Type | VirtFusion storage profile | ID |
If your configurable option names differ from the defaults above:
- Copy
config/ConfigOptionMapping-example.phptoconfig/ConfigOptionMapping.php - Edit the mapping array:
return [
'memory' => 'RAM', // Your option name for memory
'cpuCores' => 'vCPU Count', // Your option name for CPU
'traffic' => 'Data Transfer', // Your option name for bandwidth
// ... add only the options that differ from defaults
];Optional. Activate the VirtFusionDns addon module to let the provisioning module manage PTR records in a PowerDNS instance automatically (and expose an rDNS editor to clients).
Prerequisites:
- PowerDNS Authoritative 4.x with the HTTP API enabled (
webserver=yes,api=yes, and anapi-key=...set) api-allow-from=must include the IP of your WHMCS host- All reverse zones you intend to use must already exist in PowerDNS. The addon never creates zones; it only PATCHes PTR RRsets into zones that are already delegated to your nameservers.
- Zones should have
soa_edit_api=INCREASE(or similar) so PowerDNS auto-bumps the SOA serial on API writes. The addon additionally callsPUT /zones/{id}/notifyafter every PATCH to push changes to slaves immediately.
Activation:
-
Copy the addon into your WHMCS install (see the Installation section for the
rsynccommand). -
In WHMCS Admin → System Settings → Addon Modules, find VirtFusion DNS and click Activate. Grant admin role access as needed.
-
Click Configure and fill in:
Field Meaning Enable rDNS Sync Master switch. When off, every PowerDNS call short-circuits — the provisioning module behaves exactly as before the addon. PowerDNS API Endpoint Scheme + host + port, no path (e.g. https://ns1.example.com:8081orhttp://10.0.0.5:8081). The module appends/api/v1/…itself.PowerDNS API Key Password-type field. Encrypted at rest by WHMCS; decrypted server-side only when PowerDNS is called. PowerDNS Server ID Almost always localhost— the PowerDNS API server identifier, not a hostname.Default PTR TTL Applied to every PTR record the module creates. Default 3600. Cache TTL How long zone listings and DNS-resolution lookups are cached. Default 60, minimum 10. -
Click Save Changes.
-
Open the addon's admin page (same menu, usually Addons → VirtFusion DNS) and click Run Test. You should see "OK — PowerDNS reachable and authenticated" followed by a list of visible zones. If you don't see your expected reverse zones here, the module won't find them either — fix PowerDNS first.
How it behaves:
| Event | Behavior |
|---|---|
| Server provisioning | Creates a PTR for every assigned IP pointing to the VirtFusion hostname — but only if that hostname's A/AAAA already resolves to the IP. Forward-missing IPs are logged and skipped (provisioning still succeeds). |
| Server rename (via client or admin) | Rewrites only PTRs whose current content equals the previous hostname. Client-customised PTRs are preserved. |
| Server termination | Deletes every PTR belonging to the server before the local record is purged. |
| Client edits PTR in the Reverse DNS panel | Validates IP ownership (cross-checked against a fresh VirtFusion fetch), PTR regex, per-IP 10-second rate limit, and forward-DNS match. Empty value deletes. |
| Daily cron | Creates PTRs for IPs that don't have one yet (and whose forward DNS resolves correctly). Additive-only — never overwrites. |
| Admin "Reconcile (force reset)" button | The only code path that overwrites a non-matching PTR — explicit admin action. |
RFC 2317 classless delegations are supported: the module parses zones like 64/64.38.186.66.in-addr.arpa. (both CIDR-prefix and block-size conventions), matches IPs by range rather than suffix, and writes PTRs with the correct classless RRset name. The PowerDNS URL-safe zone ID encoding (/ → =2F) is handled transparently.
Security posture:
- PowerDNS integration is opt-in — if the addon is deactivated or
Enable rDNS Syncis off, the provisioning module behaves exactly as before. - Every client-facing rDNS endpoint validates service ownership and re-verifies the IP is currently assigned to the requesting user's server (defends against stale-ownership after IP reassignment).
- The API key is stored encrypted in
tbladdonmodulesby WHMCS; it is never logged. - DNS write failures never block VirtFusion operations — provisioning, rename, and termination all succeed regardless of PowerDNS state, and errors are recorded in the WHMCS Module Log for review.
Displays real-time server information fetched from VirtFusion:
- Server name and hostname
- Memory, CPU cores, storage allocation
- IPv4 and IPv6 addresses
- Traffic usage vs. allocation
- Server status badge (Active, Suspended, etc.)
Four power control buttons:
- Start - Boot the server
- Restart - Graceful restart
- Shutdown - Graceful ACPI shutdown
- Force Off - Immediate power cut (use with caution)
- View all IPv4 addresses and IPv6 subnets assigned to the server
- Copy IP addresses to clipboard with one click
- Opens a browser-based VNC console to the server
- Requires VirtFusion v6.1.0+ and the server must be running
- Opens in a new browser window/tab
- Select from available OS templates (filtered by server package)
- Includes a confirmation dialog warning about data loss
- Triggers email notification on completion
- One-click login to the VirtFusion panel
- Opens in a new window (with fallback to same-window navigation)
- Password reset option for direct VirtFusion panel access
- Product name and group
- Recurring amount and billing cycle
- Registration and next due dates
- Payment method
A panel listing every IP assigned to the server with an inline editor for the PTR record:
- One input per IP — populate to set a custom PTR, leave blank to delete
- Per-row status badge (OK / unverified / no PTR / no zone / error)
- Saves are rate-limited to one write per IP per 10 seconds
- Forward DNS must already resolve to the IP; mismatches show an inline error guiding the client to fix their A/AAAA first
- Hidden entirely when the addon is not activated
When viewing a service in WHMCS admin, the module adds:
- Server ID - Editable field showing the VirtFusion server ID
- Server Info - Button to load live data from VirtFusion API
- Server Object - Full JSON response viewer
- Options - Admin impersonation link
- Reverse DNS (when the VirtFusion DNS addon is activated) - Live per-IP PTR status plus Reconcile (additive) and Reconcile (force reset) buttons
- Create - Provision a new server
- Suspend / Unsuspend - Manage server suspension
- Terminate - Delete the server (with 5-minute grace period in VirtFusion)
- Change Package - Update server to a different VirtFusion package
- Update Server Object - Refresh cached data from VirtFusion
- Validate Server Config - Dry run server creation to test configuration
This module is designed to work with all WHMCS themes:
| Theme | Status | Notes |
|---|---|---|
| Six (default) | Fully compatible | Bootstrap 3 |
| Twenty-One | Fully compatible | Bootstrap 4 |
| Lagom (ModulesGarden) | Fully compatible | Bootstrap 5 |
| Custom themes | Compatible | Uses dual CSS classes |
The module uses dual CSS class names that work across Bootstrap versions:
panel card- Works in BS3 (panel) and BS4/BS5 (card)panel-heading card-header- Works in BS3 and BS4/BS5panel-body card-body- Works in BS3 and BS4/BS5panel-title card-title- Works in BS3 and BS4/BS5
The order form hooks use vanilla JavaScript (no jQuery dependency) for maximum compatibility.
To customize templates for a specific theme:
/templates/yourthemename/modules/servers/VirtFusionDirect/
overview.tpl # Client area template
error.tpl # Error template
WHMCS automatically loads theme-specific templates when they exist. Copy the originals from modules/servers/VirtFusionDirect/templates/ as a starting point.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/connect |
Connection testing |
GET/POST |
/users |
User lookup and creation |
GET |
/users/{id}/byExtRelation |
Find VirtFusion user by WHMCS ID |
POST |
/servers |
Server creation |
POST |
/servers?dryRun=true |
Dry run validation |
POST |
/servers/{id}/build |
OS installation / rebuild |
GET |
/servers/{id} |
Server details (also used by UsageUpdate) |
DELETE |
/servers/{id} |
Server termination |
POST |
/servers/{id}/suspend |
Server suspension |
POST |
/servers/{id}/unsuspend |
Server unsuspension |
PUT |
/servers/{id}/package/{pkgId} |
Package changes |
| Method | Endpoint | Purpose |
|---|---|---|
POST |
/servers/{id}/power/{action} |
Power management |
PATCH |
/servers/{id}/name |
Server renaming |
POST |
/users/{id}/serverAuthenticationTokens/{serverId} |
SSO token |
POST |
/users/{id}/byExtRelation/resetPassword |
Password reset |
GET |
/media/templates/fromServerPackageSpec/{id} |
OS templates |
GET |
/ssh_keys/user/{id} |
SSH key listing |
| Method | Endpoint | Purpose |
|---|---|---|
POST |
/ssh_keys |
Create SSH key for a user (checkout key paste) |
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/selfService/usage/byUserExtRelationId/{id} |
Usage data by WHMCS client ID |
GET |
/selfService/report/byUserExtRelationId/{id} |
Billing report by WHMCS client ID |
POST |
/selfService/credit/byUserExtRelationId/{id} |
Add credit by WHMCS client ID |
GET |
/servers/{id}/traffic |
Traffic statistics |
GET |
/backups/server/{id} |
Backup listing |
POST |
/servers/{id}/vnc |
Toggle VNC on/off |
POST |
/servers/{id}/resetPassword |
Reset server root password |
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/servers/{id}/vnc |
VNC console (v6.1.0+) |
PUT |
/servers/{id}/modify/memory |
Modify memory (v6.2.0+) |
PUT |
/servers/{id}/modify/cpuCores |
Modify CPU cores (v6.2.0+) |
PUT |
/servers/{id}/modify/traffic |
Modify traffic (v6.0.0+) |
POST/DELETE |
/servers/{id}/backup/plan |
Backup plan management (v4.3.0+) |
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/v1/servers/{id} |
Health check (Test Connection button) |
GET |
/api/v1/servers/{id}/zones |
Zone discovery (cached per cacheTtl) |
GET |
/api/v1/servers/{id}/zones/{zone} |
Fetch current RRsets for status + reads |
PATCH |
/api/v1/servers/{id}/zones/{zone} |
Create / replace / delete PTR RRsets |
PUT |
/api/v1/servers/{id}/zones/{zone}/notify |
NOTIFY slaves after every successful PATCH |
Authentication is via the X-API-Key header (configured in the addon). Zone IDs containing / (RFC 2317 classless) are URL-encoded as =2F per PowerDNS convention.
The module implements the UsageUpdate function that is called by the WHMCS daily cron. It automatically syncs:
- Disk usage (used and limit) from VirtFusion to WHMCS
tblhosting - Bandwidth usage (used and limit) from VirtFusion to WHMCS
tblhosting
This data appears in the WHMCS client area and admin product details.
Requirements: The WHMCS cron must be running (php -q /path/to/whmcs/crons/cron.php). No additional configuration is needed - the module registers itself automatically.
How it works:
- WHMCS calls
VirtFusionDirect_UsageUpdate()once per configured server - The module queries all Active services assigned to that server
- For each service, it fetches server data from VirtFusion API
- Disk and bandwidth usage/limits are written to
tblhosting
Data format conversion:
- VirtFusion traffic: bytes -> WHMCS expects: MB
- VirtFusion storage: bytes -> WHMCS expects: MB
- VirtFusion storage limit: GB -> WHMCS expects: MB
- VirtFusion traffic limit: GB -> WHMCS expects: MB (0 = unlimited)
| Symptom | Cause | Solution |
|---|---|---|
| "Authentication failed" | Invalid or expired API token | Generate a new token in VirtFusion |
| "Connection failed" | Hostname unreachable or SSL issue | Verify hostname, check SSL cert validity |
| "Unexpected response" | API version mismatch or server issue | Check VirtFusion is running, verify API version |
| Symptom | Cause | Solution |
|---|---|---|
| "Service already exists" | Duplicate provisioning attempt | Run termination first, then create |
| "No Control server found" | No VirtFusion server in WHMCS | Add server in System Settings > Servers |
| "Unable to create user" | API permission issue | Check token has user create permission |
| "Server creation failed" | Invalid config options | Use "Validate Server Config" button to diagnose |
| HTTP 423 response | Server is locked | Wait and retry, or check VirtFusion for lock reason |
- Verify the Package ID (Config Option 2) is correct
- Check that the package has OS templates assigned in VirtFusion
- Ensure the "Initial Operating System" custom field exists (exact name match required)
- Check that hooks are loading: re-save product settings to trigger hook detection
- Inspect browser console for JavaScript errors
- Ensure a VirtFusion server is configured and linked to the product
- Check the service status is Active or Suspended (not Pending/Terminated)
- Review Utilities > Logs > Module Log for API errors
- Verify the
mod_virtfusion_directtable has an entry for the service
- VirtFusion panel must be accessible from the client's browser
- Verify the VirtFusion user exists (check by external relation ID in VirtFusion admin)
- Ensure authentication token generation is enabled on the API token
- Check for popup blockers if the new window doesn't open
- Requires VirtFusion v6.1.0 or higher
- The server must be powered on and running
- Check that VNC is enabled for the hypervisor in VirtFusion
- Popup blockers may prevent the console window from opening
- Verify the WHMCS cron is running:
php -q /path/to/whmcs/crons/cron.php - Check Utilities > Logs > Module Log for UsageUpdate errors
- Ensure services are in "Active" status (other statuses are skipped)
- The cron runs daily; wait for the next cycle after initial setup
-
VNC Console - Requires VirtFusion v6.1.0+. Earlier versions do not expose a VNC API endpoint. The module gracefully handles this by showing an error message.
-
Resource Modification - Memory and CPU modification requires VirtFusion v6.2.0+. Traffic modification requires v6.0.0+. Backup management requires v4.3.0+.
-
IPv6 Display - IPv6 subnet display depends on the VirtFusion installation having IPv6 pools configured. If no IPv6 is assigned, the network panel shows "No IPv6 subnets".
-
Order Form Custom Fields - The custom fields ("Initial Operating System" and "Initial SSH Key") must be named exactly as specified. The module matches by field name with spaces removed and converted to lowercase.
-
Hooks File Detection - WHMCS detects the
hooks.phpfile when the module is first activated. If you add the module files to an already-active installation, you may need to deactivate and reactivate the module, or re-save the product settings. -
Bootstrap 3 Themes - While the module supports BS3 themes, some visual differences may exist (e.g.,
d-flexnot available in BS3). The module usesdisplay: flexin CSS as a fallback. -
Concurrent API Calls - The module makes individual API calls for each feature panel on the client area page. If the VirtFusion API is slow, the page may take longer to fully load. All panels load asynchronously to minimize perceived delay.
-
Self-Signed SSL Certificates - SSL verification is enforced by default. VirtFusion panels using self-signed certificates will cause connection failures. Use a valid SSL certificate (e.g., Let's Encrypt) on your VirtFusion panel.
- All client API endpoints validate service ownership before processing
- Admin endpoints require WHMCS admin authentication
- Input sanitization on all user-supplied parameters (type casting, regex filtering,
filter_var) - Proper HTTP status codes (401, 403, 400, 500) for error responses
- XSS prevention via
htmlspecialchars(),encodeURIComponent(), and jQuery.text()
- API Tokens: Store only in the WHMCS server password field (encrypted at rest by WHMCS)
- SSL Verification: Enabled by default. Never disable in production.
- File Access: All PHP files include direct access prevention checks
- Module Updates: Keep updated for security patches
- Permissions: Use the minimum required API token permissions
If you discover a security vulnerability, please report it responsibly by emailing the maintainers rather than opening a public issue. See SECURITY.md for details.
modules/servers/VirtFusionDirect/
VirtFusionDirect.php # WHMCS module entry point (MetaData, ConfigOptions, all module functions)
client.php # Client-facing AJAX API (authenticated, ownership-validated)
admin.php # Admin-facing AJAX API (admin authentication required)
hooks.php # WHMCS hooks (order form OS/SSH dropdowns, checkout validation, daily rDNS cron)
lib/
Module.php # Base class: API communication, power, network, VNC, rebuild
ModuleFunctions.php # Provisioning: create, suspend, unsuspend, terminate, change package
ConfigureService.php # Order configuration: OS templates, SSH keys, server build init
Database.php # Database operations: custom table, WHMCS table queries
Cache.php # Two-tier cache: Redis with filesystem fallback
Curl.php # HTTP client: GET, POST, PUT, PATCH, DELETE with SSL verification
ServerResource.php # Data transformer: VirtFusion API response -> display format
AdminHTML.php # Admin interface: HTML generation for admin services tab
Log.php # Logging: WHMCS module log integration
PowerDns/
Client.php # PowerDNS HTTP API wrapper (X-API-Key, ping, listZones, getZone, patchRRset, notifyZone)
Config.php # Loads + decrypts addon settings from tbladdonmodules
IpUtil.php # PTR-name generation, IP extraction, RFC 2317 parsing, zone matching
Resolver.php # Forward-DNS verification (dns_get_record + CNAME chain, cached)
PtrManager.php # Orchestrator: syncServer, deleteForServer, listPtrs, setPtr, reconcile, reconcileAll
templates/
overview.tpl # Client area Smarty template (all management panels)
error.tpl # Error display template
css/module.css # Module styles (responsive, BS3/4/5 compatible)
js/module.js # Client JavaScript (all AJAX interactions)
js/keygen.js # SSH Ed25519 key generator (Web Crypto API)
config/
ConfigOptionMapping-example.php # Example custom option name mapping
modules/addons/VirtFusionDns/ # Optional — only needed for reverse DNS support
VirtFusionDns.php # Addon entry point: _config(), _activate(), _deactivate(), _output() (Test Connection page)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes with clear messages
- Push to your fork and open a Pull Request
For bug reports, please include:
- WHMCS version
- VirtFusion version
- PHP version
- Steps to reproduce
- Module Log output (Utilities > Logs > Module Log)
This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details.
Copyright (c) EZSCALE