From 1ce3baa5a24686f22dca286b8b748f867ac72296 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 19 Feb 2026 18:27:58 +0000 Subject: [PATCH] Autosave: 20260219-182758 --- index.php | 74 ++++++++++++++++++++++++++++++++++++++++++ lib/LicenseService.php | 7 ++++ post_debug.log | 2 ++ 3 files changed, 83 insertions(+) diff --git a/index.php b/index.php index 77246d7..1e17142 100644 --- a/index.php +++ b/index.php @@ -1655,6 +1655,7 @@ $page_permissions = [ 'logs' => 'users_view', 'cash_registers' => 'users_view', 'register_sessions' => 'pos_view', + 'licenses' => 'users_view', ]; if (isset($page_permissions[$page]) && !can($page_permissions[$page])) { @@ -2304,6 +2305,11 @@ switch ($page) { $data['cash_registers'] = db()->query("SELECT * FROM cash_registers WHERE status = 'active'")->fetchAll(); $data['users'] = db()->query("SELECT id, username FROM users ORDER BY username ASC")->fetchAll(); break; + case 'licenses': + $res = LicenseService::listLicenses(); + $data['licenses'] = $res['success'] ? $res['data'] : []; + $data['license_error'] = $res['success'] ? '' : ($res['error'] ?? 'Failed to fetch licenses.'); + break; default: $data['customers'] = db()->query("SELECT * FROM customers WHERE type = 'customer' ORDER BY id DESC LIMIT 5")->fetchAll(); // Dashboard stats @@ -2616,6 +2622,9 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System'; + + + @@ -7151,6 +7160,71 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System'; + +
+
+
+
Manage Licenses
+

View and search license keys activated on your system

+
+
+ +
+
+
+ +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDLicense KeyMaxUsedStatusCreated At
+ + No license data found on the server. +
# + + Active + + Inactive + +
+
+
+
+
diff --git a/lib/LicenseService.php b/lib/LicenseService.php index 1212de1..8fa8b8c 100644 --- a/lib/LicenseService.php +++ b/lib/LicenseService.php @@ -137,6 +137,13 @@ class LicenseService { return ['success' => true]; } + /** + * Fetches all licenses from the remote server. + */ + public static function listLicenses() { + return self::callRemoteApi('/list', []); + } + /** * Remote API Caller */ diff --git a/post_debug.log b/post_debug.log index 4b9a051..a764fdd 100644 --- a/post_debug.log +++ b/post_debug.log @@ -109,3 +109,5 @@ 2026-02-19 18:07:51 - POST: {"license_key":"FLAT-TEST-1234-5678","activate":""} 2026-02-19 18:08:00 - POST: {"license_key":"FLAT-TEST-1234-5678","activate":""} 2026-02-19 18:08:08 - POST: {"license_key":"FLAT-TEST-1234-5678","activate":""} +2026-02-19 18:15:44 - POST: {"license_key":"FLAT-5FDB-C2BB","activate":""} +2026-02-19 18:26:28 - POST: {"license_key":"FLAT-5FDB-C2BB","activate":""}