Fix edit host. (#7755)

This commit is contained in:
Nicolo Maio 2023-08-11 20:15:18 +02:00
parent 6790142885
commit 14c22ef251
8 changed files with 104 additions and 25 deletions

View file

@ -14,6 +14,8 @@ local host = _GET["host"]
local scan_type = _GET["scan_type"]
local scan_ports = _GET["scan_ports"]
local scan_frequency = _GET["auto_scan_frequency"]
local scan_id = _GET["scan_id"] or nil
local cidr = _GET["cidr"]
@ -24,12 +26,12 @@ end
local result = nil
if isEmptyString(cidr) then
result = vs_utils.save_host_to_scan(scan_type, host, nil, nil, nil, 5, scan_ports, scan_frequency)
result = vs_utils.save_host_to_scan(scan_type, host, nil, nil, nil, 5, scan_ports, scan_frequency, scan_id)
else
local hosts_to_save = vs_utils.get_active_hosts(host, cidr)
for _,item in ipairs(hosts_to_save) do
result = vs_utils.save_host_to_scan(scan_type, item, nil, nil, nil, 5, scan_ports, scan_frequency)
result = vs_utils.save_host_to_scan(scan_type, item, nil, nil, nil, 5, scan_ports, scan_frequency, nil, nil, nil, scan_id )
end
end