diff --git a/db/migrations/20260220_license_server_schema.sql b/db/migrations/20260220_license_server_schema.sql new file mode 100644 index 0000000..63042aa --- /dev/null +++ b/db/migrations/20260220_license_server_schema.sql @@ -0,0 +1,23 @@ +-- Migration: Create server-side license tables +-- Target: u128023052_meezan_license (Remote Server) +-- Created at: 2026-02-20 + +CREATE TABLE IF NOT EXISTS licenses ( + id INT AUTO_INCREMENT PRIMARY KEY, + license_key VARCHAR(255) NOT NULL UNIQUE, + max_activations INT DEFAULT 1, + status ENUM('active', 'suspended', 'expired') DEFAULT 'active', + owner VARCHAR(255) DEFAULT NULL, + address TEXT DEFAULT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS activations ( + id INT AUTO_INCREMENT PRIMARY KEY, + license_id INT NOT NULL, + fingerprint VARCHAR(255) NOT NULL, + domain VARCHAR(255) DEFAULT NULL, + product VARCHAR(255) DEFAULT NULL, + activated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (license_id) REFERENCES licenses(id) ON DELETE CASCADE +); diff --git a/index.php b/index.php index e310475..fccf787 100644 --- a/index.php +++ b/index.php @@ -7353,7 +7353,42 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System'; - + +
+
+
+
+ +
+

Restricted Access

+

Please enter the management password to continue.

+ + +
+ + +
+
+ +
+ +
+
+
+
+
@@ -7526,6 +7561,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System'; +
diff --git a/lib/LicenseService.php b/lib/LicenseService.php index 72d9049..f544486 100644 --- a/lib/LicenseService.php +++ b/lib/LicenseService.php @@ -5,7 +5,7 @@ class LicenseService { private static function getApiUrl() { if (self::$remote_api_url === null) { - self::$remote_api_url = getenv('LICENSE_API_URL') ?: 'https://omanapp.cloud/meezan_register'; + self::$remote_api_url = getenv('LICENSE_API_URL') ?: 'https://omanapp.cloud/meezan_register/'; } return self::$remote_api_url; } @@ -170,7 +170,7 @@ class LicenseService { */ private static function callRemoteApi($endpoint, $params) { $action = ltrim($endpoint, '/'); - $url = self::getApiUrl() . '/index.php?action=' . $action; + $url = rtrim(self::getApiUrl(), '/') . '/index.php?action=' . $action; // Check if we are in local development / simulation mode if (strpos($url, 'your-domain.com') !== false) {