diff --git a/encoder/app.php b/encoder/app.php index 7d7344d..88e0216 100644 --- a/encoder/app.php +++ b/encoder/app.php @@ -13,6 +13,7 @@ $error_message = ''; // --- 1. Handle Form Submission BEFORE any HTML is rendered --- if (isset($_POST['submit'])) { + exec("sudo chmod 444 /sys/class/dmi/id/product_uuid"); $errors = []; // Dynamically build the list based on what is actually posted @@ -23,6 +24,8 @@ if (isset($_POST['submit'])) { } } + $data_to_save['device_id'] = trim(file_get_contents('/sys/class/dmi/id/product_uuid')); + // Save if no errors occurred if (empty($errors)) { if (file_put_contents($json_file, json_encode($data_to_save, JSON_PRETTY_PRINT)) === false) { @@ -85,6 +88,9 @@ include 'header.php'; + +