Control Web Panel

Developers => New Modules => Topic started by: Watchdog on August 18, 2026, 06:48:48 AM

Title: CWP module for WHMCS - rewritten for PHP 8 / WHMCS 9 (drop-in, MIT)
Post by: Watchdog on August 18, 2026, 06:48:48 AM
The official cwp7 module hasn't changed since 30 March 2020. WHMCS has shipped 15 releases since then and now requires PHP 8.2, so I rewrote it.

It's a drop-in replacement: same module name, same directory, same config option order. Existing server entries, products and services keep working with no reconfiguration.

https://github.com/bradleygb/whmcs-cwp-module (https://github.com/bradleygb/whmcs-cwp-module)




Why you'd switch

Running the 2020 module today, these are live faults, not style complaints:





What's in the rewrite

All of the above fixed. TLS verification on by default with optional certificate pinning. The API key masked in logs and stripped from CWP's own error text - CWP echoes it back inside "Unauthorized action". Autologin sessions minted on click through WHMCS single sign-on. Account creation given its own 180-second budget, and a creation that times out is reconciled rather than left as an orphaned account.

Added: MetaData, TestConnection, ServiceSingleSignOn, ListAccounts for Server Sync, live account detail on the admin service page, and a client area block that makes no API call while rendering - so an unreachable panel can't stall a customer's page.

Optionally, changing a service's Product/Service applies the package to CWP directly, with no second click.

Errors name the exact API Manager function and action when a permission is missing, which matters because CWP's internal permission names don't match its own labels - account/udp is checked as "accout_upd".




Requirements

WHMCS 8.5-9.0, PHP 7.4-8.3, curl and json. Tested on 7.4, 8.0, 8.1, 8.2 and 8.3. MIT licensed. Community module, not affiliated with the CWP project.

Install

Extract into modules/servers/ and press Test Connection. PERMISSIONS.md lists the exact API Manager grants - note the grid is per function and per action, and an action left off produces "Unauthorized action" even when the function looks enabled.

Upgrading: replace the directory contents, nothing else. One thing can stop a previously "working" install - TLS verification is now on. If CWP serves a certificate from a public CA on 2304 you're fine; if it's self-signed, the README covers pinning it.

Issues and pull requests welcome.
Title: Re: CWP module for WHMCS - rewritten for PHP 8 / WHMCS 9 (drop-in, MIT)
Post by: Watchdog on September 02, 2026, 10:10:05 PM
Update — a few versions have gone by since I posted this, so here's the lot.

https://github.com/bradleygb/whmcs-cwp-module/releases (https://github.com/bradleygb/whmcs-cwp-module/releases)

The theme since the first post has been giving non-technical clients what they need without sending them into CWP at all. Most of mine only use their hosting for email — they don't want a control panel, they want to add a mailbox and change a password. That happens in the WHMCS client area now, and the ones who do want the panel still have the login button.

(https://raw.githubusercontent.com/bradleygb/whmcs-cwp-module/main/docs/screenshots/client-area-dashboard.png)

(https://raw.githubusercontent.com/bradleygb/whmcs-cwp-module/main/docs/screenshots/client-area-mailboxes.png)




Packages (2.1.0)


Client area (2.2.0 – 2.5.1)


Fixed


A few API things I worked out the hard way, in case it saves anyone else the time:





Extract over modules/servers/cwp7/ and run Test Connection.