🚀 SysTikBill License Setup Guide

Complete documentation for client deployment and license management

📋 Pre-requisites

1. Add Client to Whitelist

Access: http://your-license-server.com/license/admin/

Steps:

  • Click "IP Whitelist"
  • Click "Add Client"
  • Fill in details:
IP/Domain: client-server-ip
Client Name: Client Company Name

2. Create License Key

Access: License Server Admin → License Keys

Steps:

  • Click "Create License"
  • Fill in details:
Username: client-admin-username
Plan Type: monthly/weekly/yearly
Custom Duration: +1 year (optional)

3. Install Modified SysTikBill

Replace these files on client's server:

Files to Replace:

system/controllers/admin.php
ui/ui/admin/admin/login.tpl

Files to Add:

/system/license/LicenseClient.php

🔧 CRITICAL: Configure License Server URL

Issue: License validation fails when license system is deployed in subdirectory

Solution:

Update the LicenseClient.php file with correct server path:

For Development (Root Directory):

class LicenseClient {
    public function validate($username, $license_key) {
        $server_url = 'http://172.16.16.97/license/api';
        // ... rest of code

For Production (Subdirectory):

class LicenseClient {
    public function validate($username, $license_key) {
        $server_url = 'http://172.16.16.97/your-folder-name/license/api';
        // ... rest of code

Better Approach (Configurable):

class LicenseClient {
    private $server_url;
    
    public function __construct($server_url = null) {
        $this->server_url = $server_url ?: 'http://172.16.16.97/license/api';
    }
    
    public function validate($username, $license_key) {
        // Use $this->server_url instead of hardcoded URL
        $data = [
            'username' => $username,
            'license_key' => $license_key,
            'api_key' => 'MAHMUD_SECRET_KEY_2024'
        ];
        
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $this->server_url . '/validate.php');
        // ... rest of code

4. Provide Client Credentials

Send this information to the client:

Login URL: https://client-server.com/admin
Username: [their admin username]
Password: [their admin password]  
License Key: [generated license key]

✅ File Structure - License Server

Development (Root):

/var/www/html/license/
├── config.php
├── LicenseSystem.php
├── api/validate.php
└── admin/ (dashboard)

Production (Subdirectory):

/var/www/html/your-folder/license/
├── config.php
├── LicenseSystem.php
├── api/validate.php
└── admin/ (dashboard)

✅ File Structure - Client

/var/www/html/ (client)
├── system/controllers/admin.php (updated)
├── system/license/LicenseClient.php
└── ui/ui/admin/admin/login.tpl (updated)

⚠️ Testing & Troubleshooting

Testing Steps:

  1. Client tries to login with license key
  2. System validates against license server
  3. Access granted/denied based on license status

Common Issues:

Debug Path Issues:

# Test the exact endpoint
curl -X POST http://172.16.16.97/your-folder/license/api/validate.php \
  -H "Content-Type: application/json" \
  -d '{"username":"test","license_key":"test","api_key":"MAHMUD_SECRET_KEY_2024"}'

Logs Location:

/var/log/apache2/error.log

🔄 Maintenance

🎉 Support Information

License Server Admin: http://your-license-server.com/license/admin/

Client Support: Provide license key and server IP for whitelisting

Default Admin Login: admin / admin123

Critical Note: Always verify license server URL matches deployment folder structure