diff --git a/crontab/cron_clean_orphan.php b/crontab/cron_clean_orphan.php new file mode 100644 index 000000000..ee116adba --- /dev/null +++ b/crontab/cron_clean_orphan.php @@ -0,0 +1,33 @@ +#!/usr/bin/php + $values) { + print("[".date("Y-m-d H:i:s"). "] Clean orphan HARDWARE_ID from ".$values["TABLE_NAME"]."\n"); + $countDeletetionRowQuery = "SELECT DISTINCT HARDWARE_ID FROM `%s` WHERE HARDWARE_ID NOT IN (SELECT ID FROM hardware)"; + $args = array($values["TABLE_NAME"]); + $countDeletetionRow = mysql2_query_secure($countDeletetionRowQuery, $_SESSION['OCS']["readServer"], $args); + + $deleteResult = mysql2_query_secure($values["deletequery"], $_SESSION['OCS']["writeServer"]); + + if($deleteResult) print("[".date("Y-m-d H:i:s"). "] ".$countDeletetionRow->num_rows." orphan HARDWARE_ID have been deleted from ".$values["TABLE_NAME"]."\n"); + else print("[".date("Y-m-d H:i:s"). "] An error occurs when attempt to clean orphan HARDWARE_ID from ".$values["TABLE_NAME"]."\n"); + } +} + +print("[".date("Y-m-d H:i:s"). "] End of process\n"); \ No newline at end of file diff --git a/plugins/main_sections/ms_snmp_inventory/ms_snmp_detail.php b/plugins/main_sections/ms_snmp_inventory/ms_snmp_detail.php index b11da7040..7b31e1e28 100755 --- a/plugins/main_sections/ms_snmp_inventory/ms_snmp_detail.php +++ b/plugins/main_sections/ms_snmp_inventory/ms_snmp_detail.php @@ -136,7 +136,11 @@ if ((isset($temp_field[1]) && isset($info_account_id[$getType][$getId]) && (array_key_exists($temp_field[0] . '_' . $temp_field[1], $info_account_id[$getType][$getId]))) || $temp_field[0] == 'TAG') { //cas of checkbox if (isset($temp_field[2])) { - $data_fields_account[$temp_field[0] . "_" . $temp_field[1]] .= $temp_field[2] . "&&&"; + $temp_field2 = $temp_field; + unset($temp_field2[0]); + unset($temp_field2[1]); + $new_value = implode(' ', $temp_field2); + $data_fields_account[$temp_field[0] . "_" . $temp_field[1]] .= $new_value . "&&&"; } else { $data_fields_account[$field] = $value; } diff --git a/var.php b/var.php index 3c9473324..4fd4c8083 100644 --- a/var.php +++ b/var.php @@ -78,7 +78,7 @@ /** * GUI Version */ -define('GUI_VER_SHOW', '2.11.1'); +define('GUI_VER_SHOW', '2.12.0'); /** * Default GUI language */