diff --git a/client_asset_add_modal.php b/client_asset_add_modal.php
index a0248c96..b3ad90b5 100644
--- a/client_asset_add_modal.php
+++ b/client_asset_add_modal.php
@@ -174,6 +174,16 @@
+
diff --git a/client_assets.php b/client_assets.php
index d3eafd68..d8a815a6 100644
--- a/client_assets.php
+++ b/client_assets.php
@@ -47,7 +47,7 @@ $row = mysqli_fetch_assoc(mysqli_query($mysqli, "
LEFT JOIN locations ON asset_location_id = location_id
WHERE asset_client_id = $client_id
AND asset_$archive_query
- AND (asset_name LIKE '%$q%' OR asset_description LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR contact_name LIKE '%$q%' OR location_name LIKE '%$q%')
+ AND (asset_name LIKE '%$q%' OR asset_description LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_ipv6 LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR contact_name LIKE '%$q%' OR location_name LIKE '%$q%')
$location_query
) AS filtered_assets;
"));
@@ -80,7 +80,7 @@ $sql = mysqli_query(
LEFT JOIN locations ON asset_location_id = location_id
WHERE asset_client_id = $client_id
AND asset_$archive_query
- AND (asset_name LIKE '%$q%' OR asset_description LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR contact_name LIKE '%$q%' OR location_name LIKE '%$q%')
+ AND (asset_name LIKE '%$q%' OR asset_description LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_ipv6 LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR contact_name LIKE '%$q%' OR location_name LIKE '%$q%')
AND ($type_query)
$location_query
ORDER BY $sort $order LIMIT $record_from, $record_to"
@@ -281,6 +281,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
} else {
$asset_ip_display = $asset_ip;
}
+ $asset_ipv6 = nullable_htmlentities($row['asset_ipv6']);
$asset_nat_ip = nullable_htmlentities($row['asset_nat_ip']);
$asset_mac = nullable_htmlentities($row['asset_mac']);
$asset_uri = nullable_htmlentities($row['asset_uri']);
diff --git a/database_updates.php b/database_updates.php
index 17512337..44324c24 100644
--- a/database_updates.php
+++ b/database_updates.php
@@ -1948,10 +1948,15 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.7'");
}
- // if (CURRENT_DATABASE_VERSION == '1.3.7') {
- // // Insert queries here required to update to DB version 1.3.8
+ if (CURRENT_DATABASE_VERSION == '1.3.7') {
+ mysqli_query($mysqli, "ALTER TABLE `assets` ADD `asset_ipv6` VARCHAR(200) DEFAULT NULL AFTER `asset_ip`");
+ mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.8'");
+ }
+
+ // if (CURRENT_DATABASE_VERSION == '1.3.8') {
+ // // Insert queries here required to update to DB version 1.3.9
// // Then, update the database to the next sequential version
- // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.8'");
+ // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.9'");
// }
diff --git a/database_version.php b/database_version.php
index bb9fbf82..741cb9c8 100644
--- a/database_version.php
+++ b/database_version.php
@@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
-DEFINE("LATEST_DATABASE_VERSION", "1.3.7");
+DEFINE("LATEST_DATABASE_VERSION", "1.3.8");
diff --git a/db.sql b/db.sql
index 07aa704c..fcabb289 100644
--- a/db.sql
+++ b/db.sql
@@ -134,6 +134,7 @@ CREATE TABLE `assets` (
`asset_serial` varchar(200) DEFAULT NULL,
`asset_os` varchar(200) DEFAULT NULL,
`asset_ip` varchar(20) DEFAULT NULL,
+ `asset_ipv6` varchar(200) DEFAULT NULL,
`asset_nat_ip` varchar(200) DEFAULT NULL,
`asset_mac` varchar(17) DEFAULT NULL,
`asset_uri` varchar(500) DEFAULT NULL,
@@ -1967,4 +1968,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2024-06-07 18:18:21
+-- Dump completed on 2024-06-10 22:10:02
diff --git a/post/asset.php b/post/asset.php
index ae8e6bbb..26c57916 100644
--- a/post/asset.php
+++ b/post/asset.php
@@ -20,6 +20,7 @@ if (isset($_POST['add_asset'])) {
if($_POST['dhcp'] == 1){
$ip = 'DHCP';
}
+ $ipv6 = sanitizeInput($_POST['ipv6']);
$nat_ip = sanitizeInput($_POST['nat_ip']);
$mac = sanitizeInput($_POST['mac']);
$uri = sanitizeInput($_POST['uri']);
@@ -51,7 +52,7 @@ if (isset($_POST['add_asset'])) {
$alert_extended = "";
- mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_description = '$description', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_nat_ip = '$nat_ip', asset_mac = '$mac', asset_uri = '$uri', asset_uri_2 = '$uri_2', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_status = '$status', asset_purchase_date = $purchase_date, asset_warranty_expire = $warranty_expire, asset_install_date = $install_date, asset_notes = '$notes', asset_network_id = $network, asset_client_id = $client_id");
+ mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_description = '$description', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_ipv6 = '$ipv6', asset_nat_ip = '$nat_ip', asset_mac = '$mac', asset_uri = '$uri', asset_uri_2 = '$uri_2', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_status = '$status', asset_purchase_date = $purchase_date, asset_warranty_expire = $warranty_expire, asset_install_date = $install_date, asset_notes = '$notes', asset_network_id = $network, asset_client_id = $client_id");
$asset_id = mysqli_insert_id($mysqli);
@@ -96,6 +97,7 @@ if (isset($_POST['edit_asset'])) {
if($_POST['dhcp'] == 1){
$ip = 'DHCP';
}
+ $ipv6 = sanitizeInput($_POST['ipv6']);
$nat_ip = sanitizeInput($_POST['nat_ip']);
$mac = sanitizeInput($_POST['mac']);
$uri = sanitizeInput($_POST['uri']);
@@ -125,7 +127,7 @@ if (isset($_POST['edit_asset'])) {
}
$notes = sanitizeInput($_POST['notes']);
- mysqli_query($mysqli,"UPDATE assets SET asset_name = '$name', asset_description = '$description', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_nat_ip = '$nat_ip', asset_mac = '$mac', asset_uri = '$uri', asset_uri_2 = '$uri_2', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_status = '$status', asset_purchase_date = $purchase_date, asset_warranty_expire = $warranty_expire, asset_install_date = $install_date, asset_notes = '$notes', asset_network_id = $network WHERE asset_id = $asset_id");
+ mysqli_query($mysqli,"UPDATE assets SET asset_name = '$name', asset_description = '$description', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', asset_os = '$os', asset_ip = '$ip', asset_ipv6 = '$ipv6', asset_nat_ip = '$nat_ip', asset_mac = '$mac', asset_uri = '$uri', asset_uri_2 = '$uri_2', asset_location_id = $location, asset_vendor_id = $vendor, asset_contact_id = $contact, asset_status = '$status', asset_purchase_date = $purchase_date, asset_warranty_expire = $warranty_expire, asset_install_date = $install_date, asset_notes = '$notes', asset_network_id = $network WHERE asset_id = $asset_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Asset', log_action = 'Modify', log_description = '$session_name modified asset $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $asset_id");