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

@ -1517,6 +1517,7 @@ function get_hosts($cat_id = null)
} }
foreach ($scan_srcs as $src) { foreach ($scan_srcs as $src) {
if(isset($src['src']) && is_a($src['src'], 'source')) {
$icon = $src['src']->get_Icon(); $icon = $src['src']->get_Icon();
if(isset($src['scan_error']) && $src['scan_error']) { if(isset($src['scan_error']) && $src['scan_error']) {
$icon = strtolower($src['src']->get_Name()) . "-failed.png"; $icon = strtolower($src['src']->get_Name()) . "-failed.png";
@ -1528,6 +1529,7 @@ function get_hosts($cat_id = null)
} }
$src_str .= "' class='checklist_image' />"; $src_str .= "' class='checklist_image' />";
} }
}
$ret['targets'][] = array_merge([ $ret['targets'][] = array_merge([
'id' => $tgt->get_ID(), 'id' => $tgt->get_ID(),

View File

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