No description
  • PHP 40.1%
  • CSS 35.4%
  • Smarty 18.6%
  • JavaScript 4.9%
  • Shell 1%
Find a file
Decobus 5779af09b9 Initial commit - XtreamUI Direct WHMCS module
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>
2026-01-12 20:02:35 +00:00
addons/xtreamui_direct Initial commit - XtreamUI Direct WHMCS module 2026-01-12 20:02:35 +00:00
servers/xtreamui_direct Initial commit - XtreamUI Direct WHMCS module 2026-01-12 20:02:35 +00:00
.gitignore Initial commit - XtreamUI Direct WHMCS module 2026-01-12 20:02:35 +00:00
LICENSE Initial commit - XtreamUI Direct WHMCS module 2026-01-12 20:02:35 +00:00
README.md Initial commit - XtreamUI Direct WHMCS module 2026-01-12 20:02:35 +00:00
sync.sh Initial commit - XtreamUI Direct WHMCS module 2026-01-12 20:02:35 +00:00

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

  1. Upload the servers/xtreamui_direct folder to /modules/servers/ in your WHMCS installation
  2. The final path should be /modules/servers/xtreamui_direct/
  1. Upload the addons/xtreamui_direct folder to /modules/addons/ in your WHMCS installation
  2. The final path should be /modules/addons/xtreamui_direct/
  3. Go to Setup > Addon Modules and activate "XtreamUI Direct"
  4. Configure the global settings (Allow User Edit, Enable Player, etc.)

Configuration

Creating a Product

  1. Go to Setup > Products/Services > Products/Services
  2. Create a new product or edit an existing one
  3. Go to the Module Settings tab
  4. Select Xtreamui_direct as the Module Name
  5. 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

  1. User Creation: When an order is placed, the module creates a user in the XtreamUI panel
  2. Credential Retrieval: The panel generates its own credentials; the module fetches them via the DataTables API
  3. User Identification: Users are tracked by the reseller_notes field containing WHMCS:{serviceid}
  4. 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:

  1. Change the module name on your products from fancy_reseller to xtreamui_direct
  2. All existing configuration options will be preserved
  3. 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_notes field containing WHMCS:{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.