Files
Santiago RodríguezandAdam Daley 08298dc89a Add auto-login support to the CWP server manager (#4459)
* Refactor getLoginUrl and improve error handling

* Replace error_log with getLog()->error

* Fall back to the plain CWP panel URL when SSO is unavailable

The auto-login endpoint is not available on every API key, so a failed
user_session request must not break the login button. Mirror the WHM
manager: log the failure (username only, never tokens or URLs) and
return the standard panel URL.

Use timer 5, matching CWP's own WHMCS module, and cover the new
behaviour with unit tests.

* Reuse the CWP test manager helper for the session request test

* Handle transport failures and non-string session URLs in CWP login

Convert Symfony transport exceptions into Server_Exception so every
CWP request failure funnels through the plain panel URL fallback,
and only accept a non-empty string session URL.

* Bound the CWP session request duration

Limit user_session to 10s idle / 20s total so a hung panel fails fast
to the manual login URL instead of stalling the page load. Other
operations keep the existing client defaults.

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2026-10-22 22:15:18 +01:00
..