No description
- PHP 40.1%
- CSS 35.4%
- Smarty 18.6%
- JavaScript 4.9%
- Shell 1%
Server module for direct XtreamUI panel integration. Drop-in replacement for Fancy Reseller module. Features: - Direct session-based authentication with XtreamUI panels - Automatic package dropdown population - Multiple billing cycle support - MAG device provisioning - Client area with M3U/portal links Includes companion addon module for global settings and email templates. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| addons/xtreamui_direct | ||
| servers/xtreamui_direct | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| sync.sh | ||
XtreamUI Direct - WHMCS Module
A WHMCS server module for direct integration with XtreamUI/Xtream Codes panels. This is a drop-in replacement for the Fancy Reseller module that connects directly to XtreamUI panels instead of using a proxy API.
Features
- Direct session-based authentication with XtreamUI panels
- Automatic package dropdown population from panel
- Support for multiple billing cycles (Monthly, Quarterly, Semi-Annual, Annual)
- MAG device provisioning support
- Compatible with fancy_reseller config options for easy migration
- Client area with M3U/portal links
- Companion addon module for global settings and email templates
Requirements
- WHMCS 8.0 or higher
- PHP 7.4 or higher with cURL extension
- XtreamUI panel with reseller access
Installation
Server Module
- Upload the
servers/xtreamui_directfolder to/modules/servers/in your WHMCS installation - The final path should be
/modules/servers/xtreamui_direct/
Addon Module (Recommended)
- Upload the
addons/xtreamui_directfolder to/modules/addons/in your WHMCS installation - The final path should be
/modules/addons/xtreamui_direct/ - Go to Setup > Addon Modules and activate "XtreamUI Direct"
- Configure the global settings (Allow User Edit, Enable Player, etc.)
Configuration
Creating a Product
- Go to Setup > Products/Services > Products/Services
- Create a new product or edit an existing one
- Go to the Module Settings tab
- Select Xtreamui_direct as the Module Name
- Configure the following options:
| Option | Description |
|---|---|
| Panel Username | Your reseller login username |
| Panel Password | Your reseller login password |
| Panel URL | Full URL to panel (e.g., http://panel.example.com:7392/) |
| Customer Portal URL | URL shown to customers for M3U/portal access |
| Package | Select package for one-time purchases |
| MAG Device | Check if provisioning MAG set-top boxes |
| Trial Product | Check if this is a trial product |
| Monthly/Quarterly/Semi-Annual/Annual Package | Select packages for recurring billing cycles |
Addon Module Settings
After activating the addon module in Setup > Addon Modules, configure:
| Setting | Description |
|---|---|
| Limit Products | Limit to 1 active product per customer |
| Allow User Edit | Let customers edit credentials/MAC in client area |
| Enable Player | Show video player in client area (requires HLS) |
The addon also creates email templates on activation:
- XtreamUI Direct M3U Email - Welcome email with M3U playlist and credentials
- XtreamUI Direct MAG Email - Welcome email for MAG device customers
Custom Fields
The module supports the following custom fields on products:
- MAC Address / MAG Address / MAG - For MAG device provisioning
- Username - Allow customers to choose their username
- Password - Allow customers to choose their password
How It Works
- User Creation: When an order is placed, the module creates a user in the XtreamUI panel
- Credential Retrieval: The panel generates its own credentials; the module fetches them via the DataTables API
- User Identification: Users are tracked by the
reseller_notesfield containingWHMCS:{serviceid} - Renewals: Extends user subscription by applying the appropriate package
Migration from Fancy Reseller
This module uses the same config option positions as fancy_reseller, making migration straightforward:
- Change the module name on your products from
fancy_resellertoxtreamui_direct - All existing configuration options will be preserved
- Test connection using the product's module settings
Client Area
The module includes a client area template with:
- Service credentials display
- M3U playlist link
- Portal URL
- Expiry information
Troubleshooting
Connection Failed
- Verify panel URL includes protocol and port (e.g.,
http://panel.example.com:7392/) - Ensure trailing slash on panel URL
- Check reseller credentials are correct
User Not Found
- Users are identified by
reseller_notesfield containingWHMCS:{serviceid} - Check if the user exists in the panel with correct notes
Package Not Loading
- Save product settings first, then reload to see package dropdown
- Verify reseller has permission to view packages
Module Functions
| Function | Description |
|---|---|
| CreateAccount | Creates new user in XtreamUI panel |
| SuspendAccount | Disables user access |
| UnsuspendAccount | Re-enables user access |
| TerminateAccount | Deletes user from panel |
| Renew | Extends subscription with package |
| ChangePackage | Updates user package |
| TestConnection | Verifies panel connectivity |
File Structure
xtreamui_direct/
├── README.md # This file
├── LICENSE # License file
├── servers/
│ └── xtreamui_direct/ # Server module (copy to /modules/servers/)
│ ├── xtreamui_direct.php # Main module file
│ ├── lib/
│ │ └── api.php # XtreamUI API class
│ ├── templates/
│ │ ├── overview.tpl # Client area template
│ │ ├── manage.tpl # Management template
│ │ ├── error.tpl # Error template
│ │ ├── watch.tpl # Video player template
│ │ ├── css/ # Stylesheets
│ │ ├── js/ # JavaScript files
│ │ └── vendor/ # Bootstrap, FontAwesome, etc.
│ └── index.php # Security file
└── addons/
└── xtreamui_direct/ # Addon module (copy to /modules/addons/)
├── xtreamui_direct.php # Addon configuration & settings
├── hooks.php # Event hooks
└── index.php # Security file
License
MIT License - see LICENSE file for details.
Support
For issues and feature requests, please use the GitHub Issues page.