This commit is contained in:
Ryan Prather 2018-11-23 09:50:42 -05:00
parent f022791e44
commit 437de8548a
No known key found for this signature in database
GPG Key ID: 66FDE2B4E8AB87A7
2 changed files with 33 additions and 23 deletions

View File

@ -1515,18 +1515,20 @@ function get_hosts($cat_id = null)
foreach ($icons as $icon => $data) {
$icon_str .= "<img src='/img/checklist_icons/$icon' title='{$data['name']}' class='checklist_image' />";
}
foreach ($scan_srcs as $src) {
$icon = $src['src']->get_Icon();
if(isset($src['scan_error']) && $src['scan_error']) {
$icon = strtolower($src['src']->get_Name()) . "-failed.png";
if(isset($src['src']) && is_a($src['src'], 'source')) {
$icon = $src['src']->get_Icon();
if(isset($src['scan_error']) && $src['scan_error']) {
$icon = strtolower($src['src']->get_Name()) . "-failed.png";
}
$src_str .= "<img src='/img/scan_types/{$icon}' title='{$src['src']->get_Name()}";
if (isset($src['file_name']) && $src['file_name']) {
$src_str .= "\n{$src['file_name']}";
}
$src_str .= "' class='checklist_image' />";
}
$src_str .= "<img src='/img/scan_types/{$icon}' title='{$src['src']->get_Name()}";
if (isset($src['file_name']) && $src['file_name']) {
$src_str .= "\n{$src['file_name']}";
}
$src_str .= "' class='checklist_image' />";
}
$ret['targets'][] = array_merge([

View File

@ -8774,25 +8774,33 @@ EOQ;
if (is_array($rows) && count($rows) && isset($rows[0])) {
if (is_null($exp_scan_srcs)) {
foreach ($rows as $row) {
$ret[$row['id']]['src'] = new source($row['id'], $row['name']);
$ret[$row['id']]['src']->set_Icon($row['icon']);
$ret[$row['id']]['scan_error'] = (boolean) $row['scanner_error'];
$ret[$row['id']]['notes'] = $row['notes'];
$ret[$row['id']]['file_name'] = ($ret[$row['id']]['file_name'] ? "{$row['file_name']} ({$row['finding_count']})" : "{$ret[$row['id']]['file_name']}\n{$row['file_name']} ({$row['finding_count']})");
$src = new source($row['id'], $row['name']);
$src->set_Icon($row['icon']);
$ret[$row['id']] = [
'src' => $src,
'scan_error' => (boolean) $row['scanner_error'],
'notes' => $row['notes'],
'file_name' => (!isset($ret[$row['id']]['file_name']) ? "{$row['file_name']} ({$row['finding_count']})" : "{$ret[$row['id']]['file_name']}\n{$row['file_name']} ({$row['finding_count']})")
];
}
} else {
foreach ($rows as $row) {
if (isset($exp_scan_srcs[$row['id']])) {
$exp_scan_srcs[$row['id']]['src']->set_Icon($row['icon']);
$exp_scan_srcs[$row['id']]['scan_error'] = (boolean) $row['scanner_error'];
$exp_scan_srcs[$row['id']]['notes'] = $row['notes'];
$exp_scan_srcs[$row['id']]['file_name'] = ($exp_scan_srcs[$row['id']]['file_name'] ? "{$row['file_name']} ({$row['finding_count']})" : "{$exp_scan_srcs[$row['id']]['file_name']}\n{$row['file_name']} ({$row['finding_count']})");
$exp_scan_srcs[$row['id']] = [
'scan_error' => (boolean) $row['scanner_error'],
'notes' => $row['notes'],
'file_name' => (!isset($exp_scan_srcs[$row['id']]['file_name']) ? "{$row['file_name']} ({$row['finding_count']})" : "{$exp_scan_srcs[$row['id']]['file_name']}\n{$row['file_name']} ({$row['finding_count']})")
];
} else {
$exp_scan_srcs[$row['id']]['src'] = new source($row['id'], $row['name']);
$exp_scan_srcs[$row['id']]['src']->set_Icon($row['icon']);
$exp_scan_srcs[$row['id']]['scan_error'] = (boolean) $row['scanner_error'];
$exp_scan_srcs[$row['id']]['notes'] = $row['notes'];
$exp_scan_srcs[$row['id']]['file_name'] = "{$row['file_name']} ({$row['finding_count']})";
$src = new source($row['id'], $row['name']);
$src->set_Icon($row['icon']);
$exp_scan_srcs[$row['id']] = [
'src' => $src,
'scan_error' => (boolean) $row['scanner_error'],
'notes' => $row['notes'],
'file_name' => "{$row['file_name']} ({$row['finding_count']})"
];
}
}