Welcome
+ + += htmlspecialchars($error) ?>
+ + + + +diff --git a/attempts.json b/attempts.json new file mode 100644 index 0000000..e69de29 diff --git a/encoder/firmware.php b/encoder/firmware.php index 073e36b..0337731 100755 --- a/encoder/firmware.php +++ b/encoder/firmware.php @@ -2,7 +2,7 @@ include 'header.php'; exec("sudo chmod 444 /sys/class/dmi/id/product_uuid"); -$version = 1; +$version = 3; function fail(string $msg): never { diff --git a/encoder/login.php b/encoder/login.php new file mode 100644 index 0000000..513da46 --- /dev/null +++ b/encoder/login.php @@ -0,0 +1,434 @@ += $MAX_ATTEMPTS && + time() - $attempts[$ip]['last'] < $LOCK_TIME + ) { + http_response_code(429); + die("Too many attempts. Try again later."); + } +} + +/* ---------- LOGIN ---------- */ +$error = ''; + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + + if (!hash_equals($_SESSION['csrf'], $_POST['csrf'] ?? '')) { + http_response_code(400); + die('Invalid request'); + } + + $username = trim($_POST['username'] ?? ''); + $password = $_POST['password'] ?? ''; + if (empty($_POST['agree'])) { + + $error = 'You must agree to the Privacy Policy and Terms & Conditions.'; + echo ''; + } + $users = load_json($usersFile); + + $valid = isset($users[$username]) && + password_verify($password, $users[$username]['password']); + + if ($valid) { + session_regenerate_id(true); + unset($attempts[$ip]); + save_json($attemptsFile, $attempts); + $_SESSION['user'] = $username; + header('Location: dashboard.php'); + exit; + } + + // Failed login + $attempts[$ip]['count'] = ($attempts[$ip]['count'] ?? 0) + 1; + $attempts[$ip]['last'] = time(); + save_json($attemptsFile, $attempts); + + $error = 'Invalid username or password'; +} +?> + + + +
+ + += htmlspecialchars($error) ?>
+ + + + ++ This document serves as a formal self-certification confirming compliance with all applicable + legal, security, and operational requirements related to the provided software, firmware, + service, or system. +
+ ++ I hereby declare and guarantee that the delivered software or system contains no malware, + spyware, backdoors, or harmful components of any kind. The system does not perform unauthorized + surveillance, user behavior tracking, or data collection beyond what is strictly required for + its intended operation. +
+ ++ No usage tracking, analytics, or hidden monitoring mechanisms are implemented. Any data processed + by the system is handled transparently and solely for functional or security-related purposes. +
+ ++ For licensing and authenticity verification purposes, limited hardware-related identifiers may + be securely stored. This information is used exclusively for license validation and protection + against unauthorized use, duplication, or redistribution. +
+ ++ The developer, author, or distributor shall not be held liable for any direct, indirect, + incidental, special, consequential, or punitive damages, including but not limited to loss + of data, system failure, business interruption, or financial loss, arising from the use, + misuse, or inability to use the software or system. +
++ The software or system is provided on an “as-is” and “as-available” basis, without warranties + of any kind, whether express or implied. The user assumes full responsibility for deployment, + configuration, operation, and compliance with applicable laws and regulations. +
+ ++ I confirm that the above statements are true and accurate to the best of my knowledge and accept + full responsibility for compliance with this declaration. +
+ +