5 Commits
Author SHA1 Message Date
Adam Daley e5fc354f39 Fix partial WHM provisioning recovery and password persistence (#4584)
* Fix recovery from partial WHM provisioning

* Add upgrade coverage for hosting provisioning state

* Reconcile interrupted WHM account creation before retrying

* Verify WHM account identity before resuming reseller setup
2026-10-26 04:36:34 +00:00
Adam Daley 5783431f08 Fix WHM package exception classification (#4583) 2026-10-26 02:36:22 +00:00
Adam Daleyandopencode 40de3ca924 Fix WHM activation failing when package already exists (#4565)
* Fix WHM activation failing when package already exists (#4560)

- Request listpkgs with want=all and parse both legacy package and modern data.pkg shapes
- On addpkg already-exists, sync via editpkg and continue; only block activation on other errors
- Include WHM reason in Server_Exception and fix placeholder keys

* Add WHM API terms to spellcheck dictionary

* Address review: use typed exception for WHM already-exists, keep reasons out of API errors

- Add Server_PackageExistsException; request() now throws generic messages and translates already-exists at the WHM boundary
- checkPackageExists() catches the typed exception instead of matching getMessage()

* Fix Rector findings: remove unused catch variable and setAccessible call

* Handle modern WHM metadata.result failures in Whm::request

---------

Co-authored-by: opencode <opencode@localhost>
2026-10-22 17:03:35 +01:00
Adam Daley 0d8a236eaf Fix Sentry-reported order validation and cPanel sync issues (#4362)
- Servicedomain order validation accepts the product context like
  its sibling service modules, fixing a TypeError when ordering
  domains through the cart. Fixes FOSSBILLING-Q0R.
- cPanel account sync casts the suspended flag to bool, fixing a
  TypeError when the API reports it as an integer.
  Fixes FOSSBILLING-N3T.
2026-09-19 16:09:13 +01:00
Adam Daley 7bf99170b9 Fix WHM reseller accounts always getting an empty ACL list (#4174)
* Fix WHM reseller accounts always getting an empty ACL list

Server_Manager_Whm::createAccount() called $package->getAcllist(),
but Server_Package has never had that method. Its __call() silently
swallows calls to undefined methods and returns '', so every reseller
account created via WHM had setacls called with an empty acllist -
wiping out the initial privileges WHM had just granted via
setupreseller.

Wire the ACL list through the existing custom-value mechanism instead
(same pattern already used for cgi, cpmod, maxlst, hasshell), and skip
the setacls call entirely when the hosting plan defines no 'acl'
custom value, so the reseller keeps WHM's default privileges instead
of having them stripped.

Fixes #4173

* Whitelist WHM API action names for cspell

src/library/Server/Manager/** is excluded from spellcheck entirely, so
Whm.php's own use of these WHM API1 action/field names never tripped
the checker. tests/Unit/Server/Manager/WhmTest.php isn't under that
exclusion, so add the same words DirectAdmin's custom-value keys
already use this pattern for (listpkgs, addpkg, createacct,
setupreseller, setacls, acllist) to cspell.json's ignoreWords.
2026-08-16 20:29:08 +01:00