From 1ac44f02bdbb40942738110216ab4fb58c976dc4 Mon Sep 17 00:00:00 2001 From: wrongecho Date: Wed, 16 Sep 2026 14:13:30 +0100 Subject: [PATCH] Bugfix: Assets not storing credentials when username not given --- agent/post/asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/post/asset.php b/agent/post/asset.php index 806dee2c1..ef03720d0 100644 --- a/agent/post/asset.php +++ b/agent/post/asset.php @@ -66,7 +66,7 @@ if (isset($_POST['add_asset'])) { // Add Primary Interface mysqli_query($mysqli,"INSERT INTO asset_interfaces SET interface_name = '01', interface_mac = '$mac', interface_ip = '$ip', interface_nat_ip = '$nat_ip', interface_ipv6 = '$ipv6', interface_primary = 1, interface_network_id = $network, interface_asset_id = $asset_id"); - if (!empty($_POST['username'])) { + if (!empty($_POST['password'])) { $username = trim(mysqli_real_escape_string($mysqli, encryptCredentialEntry($_POST['username']))); $password = trim(mysqli_real_escape_string($mysqli, encryptCredentialEntry($_POST['password'])));